I hereby claim:
- I am thegorgon on github.
- I am jreiss (https://keybase.io/jreiss) on keybase.
- I have a public key whose fingerprint is 93AC 97F4 9EC7 F653 425B AEAC 8F86 D4A1 4B49 63F6
To claim this, I am signing this object:
(function($) { | |
$.provide = function(object, name, features) { | |
object[name] = object[name] || {}; | |
$.extend(object[name], features); | |
return object; | |
}; | |
}(jQuery)); | |
// Use Case : | |
// $.provide(GlobalObject, "Feature", { |
class DuplicateConstantError < StandardError; end | |
module UniqConstants | |
def uniq_constants! | |
values = constants.group_by { |c| const_get(c) } | |
dupes = values.values.select { |a| a.length > 1 } | |
raise DuplicateConstantError, "Duplicate constants defined : #{dupes.flatten.inspect}" if dupes.present? | |
end | |
end |
#!/usr/bin/ruby | |
require 'curb' | |
require 'nokogiri' | |
require 'cgi' | |
loop do | |
puts "What would you like to search? (:quit to exit)" | |
search = gets | |
break if search.strip == ":quit" || search.strip.length == 0 |
function cleanup() { | |
for release in `ls -x /u/app/releases/` | |
do | |
if [ $release != "./" -a $release != "../" -a "`readlink /u/app/current`/" != "/u/app/releases/$release" ]; then `rm -rf /u/app/releases/$release`; fi | |
done | |
} |
SELECT | |
service_regions.name region_name, | |
SUM(cart_items.quantity) total_quantity, | |
offers.name offer_name | |
FROM | |
orders | |
INNER JOIN cart_items ON cart_items.order_id = orders.id | |
INNER JOIN offers ON offers.id = cart_items.offer_id | |
INNER JOIN service_regions ON service_regions.id = orders.service_region_id | |
WHERE |
SELECT | |
service_regions.name region_name, | |
COUNT(orders.id) order_count, | |
AVG(orders.price) avg_price, | |
STDDEV_POP(orders.price) std_price, | |
MIN(orders.price) min_price, | |
MAX(orders.price) max_price | |
FROM orders | |
INNER JOIN service_regions ON service_regions.id = orders.service_region_id | |
WHERE |
I hereby claim:
To claim this, I am signing this object:
#! /usr/bin/env ruby | |
require 'fileutils' | |
require 'optparse' | |
require 'csv' | |
chunks = [[]] | |
options = { input: nil, output: nil, size: 1000 } |
create_table :relationships do |t| | |
t.belongs_to :entity_left, polymorphic: true | |
t.belongs_to :entity_right, polymorphic: true | |
t.string :relationship_type | |
t.string :relationship_type_other | |
t.integer :ownership_percentage # For beneficial ownership | |
t.boolean :relationship_continues # For institution relationships | |
t.date :actioned_at # For institution relationships | |
t.string :status # For institution relationships | |
t.jsonb :other_metadata # For other relationships |