Skip to content

Instantly share code, notes, and snippets.

mutation resizeImage{
small: resize(url:"http://i.imgur.com/sybkv4j.jpg", w: 100, h: 100)
medium: resize(url:"http://i.imgur.com/sybkv4j.jpg", w: 300, h: 300)
large: resize(url:"http://i.imgur.com/sybkv4j.jpg", w: 450, h: 450)
}
{
by_loid(loid:"1.0.600860989") {
... on Story {
thumbnail {
...thumbnailInfo
}
headline
summary
}
... on LayoutContainer {
import Json.Decode exposing (..)
import Html exposing (text)
main =
let
result = decodeString string "\"test\""
in
case result of
Ok r ->
r |> toString |> text
module Main exposing (..)
import Html exposing (text)
import Html.App as App
import MyApp exposing (init, update, subscriptions)
main : Program Never
main =
App.program
applyMessages : Model -> List Msg -> ( Model, Cmd Msg )
applyMessages model msgs =
let
reduce : Msg -> ( Model, List (Cmd Msg) ) -> ( Model, List (Cmd Msg) )
reduce msg ( oldModel, cmds ) =
let
( newModel, cmd ) =
update msg oldModel
in
( newModel, cmd :: cmds )
import Html exposing (text)
import Json.Decode exposing (decodeString, int)
-- this won't work
i : String
i =
"726826386187374600"
main =
module Start exposing (start, Config, App)
{-| This module helps you start your application in a typical Elm workflow.
It assumes you are following [the Elm Architecture][arch] and using
[elm-effects][]. From there it will wire everything up for you!
**Be sure to [read the Elm Architecture tutorial][arch] to learn how this all
works!**
[arch]: https://github.com/evancz/elm-architecture-tutorial
@liamcurry
liamcurry / autoexec.cfg
Last active January 4, 2016 15:39
ET config
// name
set nick "billsacks"
// computer settings/memory
set com_soundMegs 64
set com_hunkMegs 128
set com_zoneMegs 64
set com_maxfps 125
set com_blood 1
@liamcurry
liamcurry / gist:7894401
Created December 10, 2013 17:20
Store common bitcoin exchange ticker data in MongoDB
#!/usr/bin/env python
import pymongo
import requests
import threading
from pprint import pprint
EXCHANGES = {
'mtgox': 'http://data.mtgox.com/api/2/BTCUSD/money/ticker',
'bitstamp': 'https://www.bitstamp.net/api/ticker/',
@liamcurry
liamcurry / eventemitter.js
Created June 19, 2013 21:06
Simple Client-side EventEmitter implementation
function EventEmitter() {}
EventEmitter.prototype.on =
EventEmitter.prototype.addListener = function (event, callback) {
this._events = this._events || {};
this._events[event] = this._events[event] || [];
this._events[event].push(callback);
return this;
};