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 / 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
@doomspork
doomspork / keybase.md
Created May 7, 2014 19:53
Keybase Identity Proof

Keybase proof

I hereby claim:

  • I am doomspork on github.
  • I am spork (https://keybase.io/spork) on keybase.
  • I have a public key whose fingerprint is DAA1 22C6 5803 2F11 6865 5211 CB3E DE36 56B1 9262

To claim this, I am signing this object:

defp handle_reply(socket, {status, payload}, :handle_in)
when is_atom(status) and is_map(payload) do
send socket.transport_pid, %Reply{status: status, topic: socket.topic,
ref: socket.ref, payload: socket.assigns ++ payload}
end
{:ok, file} = File.open 'test.txt', [:write]
escaped = "foo&quote;bar&#39;s"
|> String.replace("&quote;", "\"")
|> String.replace("&#39;", "'")
|> String.replace("&#38;", "&")
file
|> IO.binwrite(escaped)
|> File.close
@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 / 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 / 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"