Skip to content

Instantly share code, notes, and snippets.

View cgiffard's full-sized avatar

Christopher Giffard cgiffard

  • Canberra, Australia
View GitHub Profile
@cgiffard
cgiffard / circular-reference-schema.ex
Created November 10, 2017 05:20
Circular references
defmodule Bureaucrat.Interfaces.GraphQL.SchemaBuilder do
@moduledoc false
require Logger
def build_schema(owner) do
date = DateTime.to_string(DateTime.utc_now)
schema_description =
"Autogenerated bureaucrat schema. Different every time! " <> date
@cgiffard
cgiffard / last-posts.csv
Last active October 21, 2017 19:03
The last 100 posts on App.net.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
Post ID, Post Timestamp, Username, Text (including machine posts)
"71081328","2017-03-17T10:03:07Z","voguemagazine","Miss Rodeo New Mexico 2016 Shows Vogue The Ropes | American Women — https://app.net/b/rqg5g"
"71081327","2017-03-17T08:04:35Z","epicurious","Classic Potato Kugel for Passover | Epicurious — https://app.net/b/rqg56"
"71081326","2017-03-17T07:07:15Z","cgiffard","Midnight PST and things are still going?"
"71081325","2017-03-17T06:45:35Z","joanna","But not forgotten. :-)"
"71081324","2017-03-17T06:43:58Z","joanna","Gone?"
"71081323","2017-03-17T06:39:02Z","joanna","Still have this channel. I don&#39;t want to close my browser!"
"71081322","2017-03-17T06:38:38Z","phoneboy","Yup, looks like the API server has shut down."
"71081321","2017-03-17T06:38:18Z","joanna","Global won&#39;t refresh on Riposte."
"71081320","2017-03-17T06:37:53Z","djscolam","#NowPlaying End Theme - Zero 7 [youtu.be] Requested by: @berg #MondayNightDanceParty #BeExcellentToEachOther. //@adnprinter #adnprinter
@cgiffard
cgiffard / api tweaking.js
Created October 20, 2015 05:28
Tweaking the space bridge API
'use strict';
var config = require('./config'),
spacebridge = require('./lib/spacebridge'),
redisInput = spacebridge.createInputStream('redis', config.input.redis);
outputBridge = spacebridge.createOutputBridge(config.output);
redisInput.pipe(outputBridge);
redisInput
@cgiffard
cgiffard / keybase.md
Created May 1, 2014 12:19
keybase.md

Keybase proof

I hereby claim:

  • I am cgiffard on github.
  • I am cgiffard (https://keybase.io/cgiffard) on keybase.
  • I have a public key whose fingerprint is 311D 52CE 648C 26B5 B656 757D 5412 7758 1FC4 D791

To claim this, I am signing this object:

@cgiffard
cgiffard / safari-tabs.js
Created April 26, 2014 12:51
Nasty hack to get Safari Tabs In Node
var applescript = require("applescript");
var getTabs = ' \n\
tell application "Safari" \n\
set urllist to URL of every tab of every window \n\
set namelist to name of every tab of every window \n\
\n\
set theDoc to "" as string \n\
set windowcount to length of urllist \n\
\n\
@cgiffard
cgiffard / significant.clip
Last active December 26, 2015 20:29
Significant whitespace
(middleware.register "logger"
(fn (number:status request:req hash:res)
(io.print (% "[%00d] %s" status req.url))))
middleware.register "logger"
fn
number:status request:req hash:res
io.print
% "[%00d] %s" status req.url
@cgiffard
cgiffard / canberrajs.md
Last active December 21, 2015 10:08
Canberra JS First Meetup, August 21st 6PM, Icelab
@cgiffard
cgiffard / madhaxx.js
Created August 14, 2013 05:28
Guess what. Overloading the JS += operator is possible, if a little contrived and probably unusable!
var assert = require("assert");
var store = {};
function resolve(item) {
return store[item];
}
var FancyObject = function() {
var arrayProperty = [];
@cgiffard
cgiffard / example-toggle.png
Last active December 11, 2015 22:19
Bookmarklet for making the LCA schedule toggle-able
example-toggle.png
@cgiffard
cgiffard / ietest.js
Created September 24, 2012 10:22
Don't have a copy of IE8 available to me right now. Can anybody tell me whether this will work?
(window.attachEvent||window.addEventListener)("load",function() {
// Event listener code in here
alert("will this fire in IE8?");
},false);