Skip to content

Instantly share code, notes, and snippets.

View csaunders's full-sized avatar

Christopher Saunders csaunders

View GitHub Profile
@csaunders
csaunders / riotapi.rb
Created May 20, 2015 22:09
A Basic Riot API Client using Rest-Client + Command Line Wrapper to show how it's used
require 'rest-client'
require 'json'
module RiotAPI
API_ROOT = 'https://na.api.pvp.net/api/lol/na/'
class Client
def initialize(api_key)
@api_key = api_key
@api = RestClient::Resource.new(API_ROOT, verify_ssl: OpenSSL::SSL::VERIFY_NONE)
@csaunders
csaunders / repl.rkt
Created March 19, 2015 23:26
WOO REPLZ!
Welcome to DrRacket, version 6.0.1 [3m].
Language: racket; memory limit: 128 MB.
exercise 2.1
1/2
-1/2
-1/5
-3/1
exercise 2.2
(0,2.5)
(1.0,3.5)
Original:
An amateur suffers from the impostor syndrome and gets paranoid about it.
A pro recognizes the impostor syndrome as a sign of personal growth.
Suggestions:
An amateur enocounters something they don't know and become paranoid about it.
A pro encounters something they don't know and see it as an avenue for personal growth.
@csaunders
csaunders / abstract.md
Created January 11, 2015 19:25
Papers We Love Toronto // Paper Abstract & Bio

Chris Saunders will be presenting the paper Teaching Garbage Collection without Implementing Compilers and Interpreters by G. Coopher, A. Guha, S. Krishnamurthi, J. McCarthy and R. Findler.

The paper covers the issues with teaching Garbage Collection in an academic setting and the pitfalls around existing solutions. In an effort to remove obstacles that prevented students from implementing they have built a system that aids in the implementation of Garbage Collectors.

Along with presenting the paper, Chris will explain garbage collection, collector techniques as well as the collector and mutator "languages" built by the authors. The system is publicly available and you can see a number of collector implementations that you

/*
* @csaunders
* @gregov
* @Abid
*/
package main
import (
"image"
@csaunders
csaunders / pl
Last active August 29, 2015 14:09
Pocket Lint: Remove the paradox of choice from your pocket articles.
#!/bin/bash
#run the app to grab a random URL then die
bundle exec ruby app.rb &
PID=$!
sleep 3
open http://localhost:4567
sleep 10
kill $PID
define :one_up do
use_synth :saw
[:e3, :g3, :e4, :c4, :d4, :g4].each do |n|
play n, release: 0.25
sleep 0.125
end
end
define :powerup do
use_synth :saw
@csaunders
csaunders / perf.out
Created August 2, 2014 13:43
Import Pipeline Performance
/Users/csaunders/development/ruby/steam-sauna [git::import_data *] [csaunders@OuterHaven] [13:41]
> bx rails c
Loading development environment (Rails 4.0.3)
irb(main):001:0> require 'benchmark'
=> false
irb(main):002:0> games = [201790, 251060, 227600]
=> [201790, 251060, 227600]
irb(main):003:0> pipeline = GameImportPipeline.new
=> #<GameImportPipeline:0x007ff8de129920>
irb(main):004:0> puts Benchmark.measure { pipeline.import(games) }
scorch() {
ps aux | grep $@ | tr -s ' ' | cut -d ' ' -f 2 | xargs kill
}
@csaunders
csaunders / _setup.md
Last active August 29, 2015 14:01
Gosu Demo

If you are on a Mac all you should need to do is:

gem install gosu

To run the game simply:

ruby pawng.rb

You will require 2 png assets: