This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "flare", | |
"children": [ | |
{ | |
"name": "analytics", | |
"children": [ | |
{ | |
"name": "cluster", | |
"children": [ | |
{"name": "AgglomerativeCluster", "size": 3938}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# TODO - use a server other than passenger? | |
# this script uses wget and passenger to crawl a rails' application in order | |
# to create a static build from virtually any project. | |
# | |
# it has three simple requirements, and one optional one: | |
# | |
# 1) you have the wget program installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails 4 Application Template | |
# Usage: rails new [app_name] -m [boost_template.rb] -d postgresql | |
# Remove normal files we don't want | |
remove_file "README.rdoc" | |
remove_file "public/index.html" | |
remove_file "app/assets/images/rails.png" | |
# Copy database.yml to sample | |
inside "config" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#require 'rubygems' | |
require 'pp' | |
#require 'ap' # Awesome Print | |
class Object | |
# expects [ [ symbol, *args ], ... ] | |
def recursive_send(*args) | |
args.inject(self) { |obj, m| obj.send(m.shift, *m) } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |
default_run_options[:pty] = true | |
# be sure to change these | |
set :github_user, '<github_user_name>' | |
set :github_application, "<repository_name>" | |
set :user, '<user_on_server>' | |
set :domain, '<server_name>' | |
set :application, '<domain_name_of_static_site>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rebuttal of http://www.try-alf.org/blog/2013-10-21-relations-as-first-class-citizen | |
require 'arel' | |
require 'sqlite3' | |
require 'pry' | |
def suppliers | |
@suppliers ||= Arel::Table.new(:suppliers) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
What happens? | |
- `new Type().what` is looked up with a call to `get` on the proxy | |
- a function is returned that will look up `METHOD_NAME` when called | |
- `METHOD_NAME` is called because of the `()` behind `new Type().what` | |
- if `METHOD_NAME` exists on you object, your own function is called | |
- if not, because of prototypal inheritance, `get` is called again | |
- `name` is now `METHOD_NAME` and we can throw as we know `METHOD_NAME` is not implemented on the type | |
credits http://soft.vub.ac.be/~tvcutsem/proxies/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pubsub = {}; | |
(function(q) { | |
var topics = {}, subUid = -1; | |
q.subscribe = function(topic, func) { | |
if (!topics[topic]) { | |
topics[topic] = []; | |
} | |
var token = (++subUid).toString(); | |
topics[topic].push({ | |
token: token, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# TODO: skip tiny files (so small they couldn't be photos) | |
# TODO: make sure sym links and other file system oddities are handled | |
# | |
# Constants | |
# | |
CHAR_COUNT=12 | |
BLOCK_COUNT=6 | |
SKIP_SIZE=3 # Every new block is sampled by skipping this amount of blocks to the next position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Snowflake 2.0a | |
Open-source "snowflake" drawing app with true vector output. | |
Click the "save" button to create a PDF document of your snowflake, | |
suitable for editing in Inkscape, Corel, Illustrator, or so forth. | |
Written by Windell H. Oskay, www.evilmadscientist.com |
OlderNewer