Skip to content

Instantly share code, notes, and snippets.

View doomspork's full-sized avatar
👋
How's it going?

Sean Callan doomspork

👋
How's it going?
View GitHub Profile
@doomspork
doomspork / atom.js
Created November 16, 2011 23:26
Raphael.js example of an animated atom
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>raphael</title>
<script src="https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael.js"></script>
<style media="screen">
body {
margin: 0;
padding: 0;
@doomspork
doomspork / cell.js
Last active September 28, 2015 03:48
Processing(.js) sketch of a "cell" pulsing.
// comments go here
boolean expanding = true;
int change = 0;
void setup()
{
size(200,200);
background(125);
fill(255);
frameRate(10);
@doomspork
doomspork / Gemfile
Created March 1, 2013 03:59
Sample non-managed currency implementation with unit test
source :rubygems
gem 'sinatra'
gem 'trollop'
gem 'faraday'
@doomspork
doomspork / play.rb
Created March 5, 2013 18:40
Get apps and their attributes from Google Play.
require 'net/https'
require 'nokogiri'
require 'uri'
module Play
STORE_IDENTIFIER_PATTERN = /(?:[\w\d]+\.)+[\w\d]+/i
class InvalidStoreId < StandardError; end
class Reader
def self.document_from_url(url)
@doomspork
doomspork / Gemfile
Created March 5, 2013 20:29
Example Rake task for downloading and unzipping a file. Usage: rake 'pull[remote_file, local_file]'
#!/usr/bin/env rake
Dir.glob('*.rake').each { |r| import r }
@doomspork
doomspork / ranking.rb
Last active December 14, 2015 13:29
JRuby script to pull iOS app ranking data from AppAnnie.com. Must be passed a file containing an app name, internal id (optional), and the store id per new line. Using System.out to print results. Example usage: ruby ranking.rb seed_file.txt > ranking.txt
require 'java'
require 'net/http'
require 'uri'
require 'nokogiri'
System = java.lang.System
java_import java.util.concurrent.Executors
@executor = Executors.newFixedThreadPool 3
require 'clerk'
require 'csv'
class ClassIdTransformer
def self.transform(id)
case id.to_i
when 1
"Fighter"
when 2
"Mage"
class SandPaper
class NoValueForRequiredField < Exception; end
class UnsupportedBooleanValue < Exception; end
TYPE_CONVERTERS = [ :boolean, :string, :integer, :float]
TYPE_CONVERTERS.each do |type|
define_method type, ->(name, options = {}) {
options[:xpath] ||= "//#{name.to_s}"
@grain[name] = options.merge type: type
@doomspork
doomspork / client.rb
Created March 18, 2014 22:54
Proof-of-concept web service client
require 'net/http'
require 'json'
class Client
class << self
attr_accessor :host, :port, :api_key, :version
end
self.host = ENV['ORDERS_API_HOST'] || 'api.orders.com'
self.port = ENV['ORDERS_API_PORT'] || 80
@doomspork
doomspork / dogs.md
Created March 27, 2014 18:18
A (incomplete) list of healthy and harmful foods for dogs.

HEALTHY

  • Acai berries
  • Alfalfa
  • Aloe vera
  • Apples (not the seeds)
  • Asparagus
  • Bananas
  • Barley
  • Beans
  • Beef