Skip to content

Instantly share code, notes, and snippets.

View robertjlooby's full-sized avatar
🐶

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.
### Keybase proof
I hereby claim:
* I am robertjlooby on github.
* I am robertjlooby (https://keybase.io/robertjlooby) on keybase.
* I have a public key ASAMTQTDlH0G8sD96hZBYVBoiundH0VBFK27Uiqjr82l7go
To claim this, I am signing this object:
{-# 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
robertjlooby / TraversableExercises.hs
Last active March 31, 2017 20:47
Three' Traversable instance
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)
@robertjlooby
robertjlooby / gist:6986296
Created October 15, 2013 04:02
Using the metra Rail-Time Tracker API
(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 "http://12.205.200.243/AJAXTrainTracker.svc/GetAcquityTrainData" {:body (generate-string body) :content-type :json})
resp-body (parse-string ((parse-string (response :body) true) :d) true)]
resp-body))
@robertjlooby
robertjlooby / elm-fibonacci.elm
Created August 19, 2015 13:46
elm-fibonacci
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
acc
@robertjlooby
robertjlooby / Color
Created January 25, 2015 22:13
rotating rainbow circles
import Color (..)
import Graphics.Collage (..)
import Graphics.Element (..)
import List
import Signal
import Time
main : Signal Element
main = Signal.map display angle
@robertjlooby
robertjlooby / active_record_gem.rb
Created December 5, 2014 19:50
Testing find_in_batches/reverse_order bug
# 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.