Skip to content

Instantly share code, notes, and snippets.

Joseph Collard jcollard

  • CT
View GitHub Profile
View gist:e269d06509aea7d0780f2b9d7c5692c8
1 Aether Tradewinds
1 Atarka's Command
1 Burnished Hart
1 Cascading Cataracts
1 Chandra, Awakened Inferno
1 Chandra's Embercat
1 Cloudkin Seer
1 Cloudthresher
1 Clutch of Currents
1 Courser of Kruphix
View buildGroups.py
def buildGroups(list, conditionChecker):
'''
Takes in a list and compiles a set of groups based on the condition checker
@param list - a list of items to be compiled into groups
@param conditionChecker - the condition checker which takes in the current group being built,
the list of groups built thus far and the current item being inspected.
If the item should be added to the current group, it returns true.
Otherwise, the current group is added to the list of groups and the item is skipped.
View Main.elm
import StartApp
import History
import Html
import Html.Events as Events
import Effects
import Task
import Signal
import Graphics.Element exposing (show)
import List
View Example.elm
import Html exposing (div, button, text, input, node)
import Html.Events exposing (onClick)
import Html.Attributes exposing (type', class)
import StartApp
main =
StartApp.start { model = model, view = view, update = update }
model = []
@jcollard
jcollard / 1.0.2.json
Created Dec 4, 2014
elm-doc src/Playground/Input.elm
View 1.0.2.json
{
"name": "Playground.Input",
"comment": "\n\n This module explains each type of Input that can be used in a Playground's\n update function.\n\n @docs RealWorld, Input",
"aliases": [
{
"name": "RealWorld",
"comment": "\n The RealWorld record contains information about the environment of the running\n program.\n\n * The `top`, `right`, `bottom`, and `left` fields represent the bounding box\n that will be rendered.\n\n * The `mouse` field is a record containing the most recent x and y positions\n of the mouse within the rendered bounding box.",
"args": [],
"type": {
"tag": "record",
@jcollard
jcollard / OutlineExample.hs
Created Oct 24, 2013
Example usage of outline' on a ColorImage
View OutlineExample.hs
import Data.Image
import Data.Image.Interactive
import System.IO.Unsafe
stopImage = unsafePerformIO $ do
stop <- readColorImage "images/stop.ppm"
return stop
binaryStop = (r + g + b) .> 196 where
(r, g, b) = colorImageToRGB stopImage
@jcollard
jcollard / circle.elm
Created Oct 8, 2013
Neat Spinning Thing! Tracing a circle that happens to be rotating around an ellipse that is wobbling.
View circle.elm
import Automaton
import Graphics.Collage
-- parameters
areaSize = 400 -- size of area to draw in
size = 3 -- size of "pixel"
rate = 32 -- Refresh rate
trail = 100 -- How long
av = 3 -- angular velocity of the inner circle
av' = 5 -- angular velocity of the outer circle
You can’t perform that action at this time.