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
# objects with at least one widget and at least one user | |
$ cat part-r-00000 | jq 'select((.widgets | length) > 0 and (.users | length) > 0)' |
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 | |
exec java \ | |
-server \ | |
-Djava.awt.headless=true \ | |
-Xms256M \ | |
-XX:CompileThreshold=1400 \ | |
-Xloggc:./memory.log -verbose:gc -XX:+PrintGCDetails \ | |
-cp out \ | |
jim.SpellCheck \ | |
$@ |
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 | |
# Our test cases will always use the same dictionary file (with SHA1 | |
# 6b898d7c48630be05b72b3ae07c5be6617f90d8e). Running `test/harness` | |
# will automatically download this dictionary for you if you don't | |
# have it already. | |
path = ARGV.length > 0 ? ARGV[0] : '/usr/share/dict/words' | |
entries = File.read(path).split("\n") |
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
public class Main { | |
// which method does it invoke? | |
public static void main(String[] args) { | |
Object o = "this is a string"; | |
asLong(o); | |
} | |
public static void asLong(String s) { | |
System.out.println("string"); |
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 'mongoid' | |
require 'fabrication' | |
Mongoid::Config.load_configuration({ | |
sessions: { | |
default: { | |
hosts: ['localhost:27017'], | |
database: 'local' | |
} | |
} |
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 | |
unless File.exists?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails', branch: 'master' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
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
function conversion(){ | |
var tracker = _gat._createTracker('UA-XXXXXXX-X'); | |
tracker._trackEvent('Users', 'Sign Up'); | |
} | |
$('.LR-sign-up-submit').click(conversion); | |
$('.LR-sign-up-input').keypress(function(c) { | |
(13 == c.which) && conversion(); | |
}); |
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 | |
# Usage: | |
# load './github.rb' | |
# 10.times { fire } | |
require 'github_api' | |
require 'faraday-http-cache' | |
require 'moneta' | |
require 'active_support/cache/moneta_store' | |
require 'logger' |
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 'github_api' | |
require 'faraday-http-cache' | |
require 'logger' | |
@store = ActiveSupport::Cache::MemoryStore.new | |
@github = Github::Repos::Contents.new do |config| | |
config.stack.insert_before Github::Response::Jsonize, Faraday::HttpCache, @store | |
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
#!/bin/sh | |
# install nodejs, if using cloudbees | |
curl -s -o use-node https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/node/use-node | |
NODE_VERSION=0.11.1 source ./use-node | |
# install phantomjs, karma | |
[ -d node_modules/phantomjs ] || npm install phantomjs | |
[ -d node_modules/karma ] || npm install karma |