Skip to content

Instantly share code, notes, and snippets.

View ocxo's full-sized avatar
💆‍♂️
domakesaythink

Adam Ochonicki ocxo

💆‍♂️
domakesaythink
View GitHub Profile
class Location
include Mongoid::Document
include Geocoder::Model::Mongoid
field :user_defined_location
field :lat, :type => Float
field :lon, :type => Float
field :coords, :type => Array
index :coords
nearbys = Location.near("Omaha, NE", 50, :order => "distance")
bearing = nearbys.first.bearing
Geocoder::Calculations.compass_point(bearing)
require 'geocoder'
class Location
include Mongoid::Document
include Geocoder::Model::Mongoid
field :user_defined_location
field :lat, :type => Float
field :lon, :type => Float
field :coordinates, :type => Array
function slide(){
var aux = '';
fadeval = 1.0;
fadeinter = setInterval('fade()',75);
}
function slide(){
var aux = '';
fadeval = 1.0;
fadeinter = setInterval('fade()',7500);
}
Process: shoes-bin [4368]
Path: /Users/USER/Downloads/Shoes.app/Contents/MacOS/shoes-bin
Identifier: shoes-bin
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: bash [4362]
Date/Time: 2011-08-19 14:50:13.681 -0400
OS Version: Mac OS X 10.7.1 (11B26)
Report Version: 9
def randy_mailman(mailbag, this_much)
mailbag.sort!{rand(this_much)}[1..this_much]
end
#!/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
#!/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
SELECT zip_code_ads.account_id, zip_code_ads.category_id,
SUM(CASE zip_code_ads.ad_type_id WHEN 1 THEN (case is_purchased when true then 1 else 0 end) ELSE 0 END) exclusive_count,
SUM(CASE zip_code_ads.ad_type_id WHEN 2 THEN (case is_purchased when true then 1 else 0 end) ELSE 0 END) enhanced_count,
SUM(CASE zip_code_ads.ad_type_id WHEN 3 THEN (case is_purchased when true then 1 else 0 end) ELSE 0 END) listing_count,
SUM(CASE zip_code_ads.ad_type_id WHEN 4 THEN (case is_purchased when true then 1 else 0 end) ELSE 0 END) free_count,
SUM(CASE zip_code_ads.ad_type_id WHEN 5 THEN (case is_purchased when true then 1 else 0 end) ELSE 0 END) temp_count,
SUM(COALESCE(zip_code_prices.excl_price, excl.price) * (CASE zip_code_ads.ad_type_id WHEN 1 THEN (case is_purchased when true then 1 else 0 end) ELSE 0 END)) exclusive_value,
SUM(COALESCE(zip_code_prices.enh_price, enha.price) * (CASE zip_code_ads.ad_type_id WHEN 2 THEN (cas