Skip to content

Instantly share code, notes, and snippets.

I am attesting that this GitHub handle christopheradams is linked to the Tezos account tz1bRFcHq4FgUhykZfGUKsiZoDuA99oVRzgi for tzprofiles
sig:edsigtagb1254o6muEXn5TpwcMisbncBcWDuW4UNhZg4uiV5CxxnsecfMUbv5zhUX2yz2LLUNhpL2uWDZnx6GWqGBLMz3AnQxMj
@christopheradams
christopheradams / merkaba.go
Last active September 19, 2017 02:13
Merkaba rendered with fogleman/ln
package main
// Instructions
// go get github.com/fogleman/ln/ln
// go build merkaba.go
// ./merkaba
// convert -loop 0 -delay 1.5 out0*.png out.gif
import "fmt"

Irssi in Mac OS X Notification Center

Mou icon

Overview

This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.

We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.

@christopheradams
christopheradams / WebPage.json
Last active August 29, 2015 14:08
Tentacles Webpage JSON-LD example
{
"@context": "http://schema.org",
"@type": "WebPage",
"author": "Staff reporter",
"copyrightHolder": "DC Thomson & Co, Ltd.",
"copyrightYear": "2014",
"dateCreated": "2011-01-10",
"dateModified": "2012-11-12",
"datePublished": "2011-01-10",
"hasPart": {
This file has been truncated, but you can view the full file.
{
"datatypes": {
"Boolean": {
"ancestors": [
"DataType"
],
"comment": "",
"comment_plain": "",
"id": "Boolean",
source :rubygems
gem 'webmachine'
gem 'rspec'
gem 'rspec_api_documentation'
gem 'rack-test'
gem 'json_spec'
@christopheradams
christopheradams / media.php
Last active August 29, 2015 14:00
Custom media media handler for JSON media type.
<?php
/**
* Create a custom handler for the JSON media type. By default `Collection::to()` will force
* indexed conversion of the collection with the document ID's as keys. This is not what we want
* for our JSON API. The handler will yield a plain old JSON array for the collection instead
* of an object by setting cast to false and then devising a custom cast function in the
* encoding step.
*/
<?php
namespace app\controllers;
use app\models\Downloads;
class DownloadsController extends \lithium\action\Controller {
public function index() {
$this->request->privateKeys = array('id', 'user_id');
@christopheradams
christopheradams / pluck.erl
Created April 9, 2014 14:10
Pluck function from newrelic-erlang
pluck(_, _, []) ->
[0];
pluck(Name, N, L) ->
lists:map(fun ([_, []]) -> 0;
([{Struct}, D]) ->
case binary:match(proplists:get_value(name, Struct), Name) of
nomatch ->
0;
_ ->
case proplists:get_value(scope, Struct) =:= <<"">> of
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",