Skip to content

Instantly share code, notes, and snippets.


Robert Looby robertjlooby

View GitHub Profile
Additional Grant of Rights
"Software" means the PROJECT software distributed by OWNER
OWNER hereby grants to each recipient of the Software
("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
(subject to the termination provision below) license under any Necessary
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
transfer the Software.
View gist:83609f1ed2fb3a3d179a2876b9976565
### Keybase proof
I hereby claim:
* I am robertjlooby on github.
* I am robertjlooby ( on keybase.
* I have a public key ASAMTQTDlH0G8sD96hZBYVBoiundH0VBFK27Uiqjr82l7go
To claim this, I am signing this object:
View bifunctor.hs
{-# LANGUAGE ScopedTypeVariables #-}
bifunctor :: forall m a b c d e f.
( Bifunctor m
, Arbitrary a, Arbitrary b, Arbitrary c
, Arbitrary d, Arbitrary e, Arbitrary f
, CoArbitrary a, CoArbitrary d
, Show (m a d), Arbitrary (m a d), EqProp (m a d), EqProp (m c f)
) =>
m (a,b,c) (d,e,f) -> TestBatch
robertjlooby / TraversableExercises.hs
Last active Mar 31, 2017
Three' Traversable instance
View TraversableExercises.hs
module TraversableExercises where
import Test.QuickCheck
import Test.QuickCheck.Checkers
import Test.QuickCheck.Classes
data Three' a b =
Three' a b b
deriving (Eq, Ord, Show)
View elm-fibonacci.elm
module Fibonacci where
import List exposing (reverse, sum, take)
import Graphics.Element exposing (show)
fibonacci : Int -> List Int
fibonacci n =
let fibonacci' n acc =
if n <= 2 then
robertjlooby / Color
Created Jan 25, 2015
rotating rainbow circles
View Color
import Color (..)
import Graphics.Collage (..)
import Graphics.Element (..)
import List
import Signal
import Time
main : Signal Element
main = display angle
robertjlooby / active_record_gem.rb
Created Dec 5, 2014
Testing find_in_batches/reverse_order bug
View active_record_gem.rb
# Activate the gem you are reporting the issue against.
gem 'activerecord', '4.1.8'
require 'active_record'
require 'minitest/autorun'
require 'logger'
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
# This connection will do for database-independent bug reports.
robertjlooby / gist:6986296
Created Oct 15, 2013
Using the metra Rail-Time Tracker API
View gist:6986296
(ns metra
(:require [cheshire.core :refer [generate-string parse-string]
[clj-http.client :as http]))
(defn get-trains []
(let [timestamp (str "/Date(" (.getTime (java.util.Date.)) "-0000)/")
body {:stationRequest {:Corridor "MD-N", :Destination "LIBERTYVIL", :Origin "CUS", :timestamp timestamp}}
response (http/post "" {:body (generate-string body) :content-type :json})
resp-body (parse-string ((parse-string (response :body) true) :d) true)]