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
function anagram(word) { | |
var originalWord = wordObject(word); | |
return { | |
matches: function(wordArray) { | |
if (typeof wordArray === 'string'){ | |
wordArray = Array.prototype.slice.call(arguments); | |
} | |
var wordMatches = []; |
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_relative 'boot' | |
db = Sequel.connect(ENV['DATABASE_URL']) | |
Urls.attach_db(db[:urls]) | |
run UrlShortener |
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 | |
require 'aws-sdk' | |
require 'pry' | |
Pry.config.prompt = [proc { "AWS> " }, proc { "AWS| " }] | |
AWS.pry |
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 'bundler' | |
Bundler.require(:default) | |
# Currency | |
# | |
# A transaction currency. | |
# | |
class Currency |
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
// ==UserScript== | |
// @name RubyDoc.info Github Source Links | |
// @description Adds view source on github links to rubydoc.info | |
// @author Jonathan Rochkind | |
// @include http://*rubydoc.info/github/* | |
// @version 1.0 | |
// ==/UserScript== | |
if (match = window.location.pathname.match(/^\/github\/([^\/]+\/[^/]+)\/([^/]+)/)) { | |
var github_project = match[1]; |
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
// Copyright 2007-2010 Wincent Colaiuta. All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are met: | |
// | |
// 1. Redistributions of source code must retain the above copyright notice, | |
// this list of conditions and the following disclaimer. | |
// 2. Redistributions in binary form must reproduce the above copyright notice, | |
// this list of conditions and the following disclaimer in the documentation | |
// and/or other materials provided with the distribution. |
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
module Callbacks | |
@@callbacks = {} | |
def has_callback_hook(name) | |
@@callbacks[name] = [] | |
class_eval <<-CLASS | |
def #{name}_add block | |
@callbacks[#{name}] << block | |
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
require 'yard' | |
YARD::Parser::SourceParser.parse_string <<-eof | |
# ### HELPERS ### | |
# Generates the base job definition hash | |
# | |
# @param [Hash] p The sanitized params sent by the user | |
# @param [Symbol] verb The job verb (:get, :post, :delete, :put) |