Run with while true; do clear; ruby a.rb | tee b.rb; sleep 1; mv -f b.rb a.rb; done
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
const graphQLFragments = (fragments = {}) => req => { | |
const uniq = list => list.filter(value => list.indexOf(value) == list.lastIndexOf(value)); | |
const hasFragment = graphQL => graphQL.match(/\.{3}\s*([A-Za-z0-9\_]+)/g) != null; | |
const findFragments = graphQL => | |
graphQL | |
.match(/\.{3}\s*([A-Za-z0-9\_]+)/g) | |
.map(fragment => fragment.trim().replace(/^\.{3}/, "")) | |
.filter(fragment => fragment.match(/\s+on\s+/) == null) | |
.map(fragment => { | |
if (fragment in fragments) { |
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
"use strict"; | |
const blackList = [ | |
"00000000000", | |
"11111111111", | |
"22222222222", | |
"33333333333", | |
"44444444444", | |
"55555555555", | |
"66666666666", |
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
class SessionFileStore < ActionDispatch::Session::AbstractStore | |
def get_session(env, sid) | |
sid ||= generate_sid | |
session = Marshal.load(IO.binread(tmp_file(sid))) rescue nil | |
[sid, session.presence || {}] | |
end | |
def set_session(env, sid, session, options) | |
Dir.mkdir(sessions_path) unless Dir.exist? sessions_path | |
IO.binwrite(tmp_file(sid), Marshal.dump(session)) |
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 "socket" | |
require "openssl" | |
require "thread" | |
require "thwait" | |
require "benchmark" | |
require "optparse" | |
require "net/http" | |
require "csv" | |
require "uri" |
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(angular) { | |
function underlineToCamelCase(string) { | |
return string.replace(/(\_[a-z])/g, function(match) { | |
return match.toUpperCase().replace("_", ""); | |
}); | |
} | |
function convertToCamelCaseObject(object) { | |
if (typeof object != "object") return object; | |
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 "rubygems" | |
require "codeplane" | |
require "optparse" | |
Codeplane.configure do |config| | |
ARGV.options do |opts| | |
opts.on("-u", "--user=username", String) { |val| config.username = val } | |
opts.on("-p", "--api-key=key", String) { |val| config.api_key = val } |
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
(def fib-seq | |
((fn fib [a b] (cons a (lazy-seq (fib b (+ b a))))) 1 1)) |