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 Hoptoad = { | |
VERSION : '0.1.0', | |
NOTICE_XML : '<?xml version="1.0" encoding="UTF-8"?><notice version="2.0"><api-key></api-key><notifier><name>hoptoad_notifier_js</name><version>0.1.0</version><url>http://hoptoadapp.com</url></notifier><error><class>EXCEPTION_CLASS</class><message>EXCEPTION_MESSAGE</message><backtrace>BACKTRACE_LINES</backtrace></error><request><url>REQUEST_URL</url><component>REQUEST_COMPONENT</component><action>REQUEST_ACTION</action></request><server-environment><project-root>PROJECT_ROOT</project-root><environment-name>production</environment-name></server-environment></notice>', | |
ROOT : window.location.protocol + '//' + window.location.host, | |
BACKTRACE_MATCHER : /^(.*)\@(.*)\:(\d+)$/, | |
backtrace_filters : [/notifier\.js/], | |
notify: function(error) { | |
var xml = escape(Hoptoad.generateXML(error)); | |
var host = Hoptoad.host || 'hoptoadapp.com'; |
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 'pg' | |
require 'FileUtils' | |
def write_file(data, path, name) | |
return if data.nil? or data.empty? | |
return if File.exists?("#{path}/#{name}") | |
FileUtils.mkdir_p path | |
f = File.new("#{path}/#{name}", 'w') | |
f.write(PGconn.unescape_bytea(data)) |
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 'aws-sdk' | |
puts "Connecting to S3 ... " | |
start_time = Time.now | |
s3 = AWS::S3.new(access_key_id: (ARGV[0] || ENV['S3_ACCESS_KEY']), | |
secret_access_key: (ARGV[1] || ENV['S3_SECRET_KEY']) ) | |
s3.buckets.each do |bucket| |
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
IO.read(Bundler.default_lockfile) |
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
App.find('4f53c660fab0b800010000a5').conversations.where(record_id: {'$exists' => 1}).each do |c| | |
record = Record.find(c[:record_id]) | |
next if record.data.blank? || c.person.blank? | |
c.person.custom_data ||= {} | |
c.person.custom_data.reverse_merge!(record.data) | |
c.person.save | |
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
[mongodb] | |
name=MongoDB Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ | |
gpgcheck=0 | |
enabled=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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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/ruby | |
BOAT_SIZES = [19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30] | |
BOAT_COUNTS = [ 3, 3, 3, 4, 5, 6, 7, 5, 4, 4, 4, 4] | |
ALL_BOATS = BOAT_SIZES.zip(BOAT_COUNTS).map { |s,c| Array.new(c, s) }.flatten | |
BUFFER = 3 # Spacing between boats | |
MAX_SIZES = 23.upto(34) # Maximum length overall permitted to moore | |
ITERATIONS = 5000 |