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
source :rubygems | |
gem 'sinatra', '1.0' | |
gem 'oauth2' | |
gem 'json' | |
group :development do | |
gem 'shotgun' | |
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
# crappy server implementation using technoweenie/oauth2 (server branch) | |
# http://github.com/technoweenie/oauth2/compare/master...server | |
# | |
# ruby oauth2_example.rb -p 4568 | |
# ruby oauth2_example.rb | |
# open http://localhost:4567/auth/facebook | |
require 'rubygems' | |
require 'sinatra' | |
require 'oauth2/client' |
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
select | |
* | |
from | |
( | |
select pav1.value make1, pav2.value year1, pav3.value model1, pav4.value style1, | |
(select value from vehicle_source.product_attribute_value where product_id=p4.product_id and attribute_id=4) ed_style_id, | |
(select value from vehicle_source.product_attribute_value where product_id=p3.product_id and attribute_id=3) ed_model_id, | |
(select value from vehicle_source.product_attribute_value where product_id=p4.product_id and attribute_id=(select attribute_id from vehicle_source.attribute where lower(trim(attribute_name))='trim level')) trim_level, | |
(select value from vehicle_source.product_attribute_value where product_id=p4.product_id and attribute_id=(select attribute_id from vehicle_source.attribute where lower(trim(attribute_name))='style start date')) style_start_date, | |
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
namespace :db do | |
desc 'Seed database from db/seed.sql file instead of the traditional db/seed.rb' | |
namespace :seed do | |
config = Rails::Configuration.new.database_configuration[RAILS_ENV] | |
seed_sql = File.expand_path(File.dirname(__FILE__) + '/../../db/seed.sql') | |
if !File.exists?(seed_sql) | |
puts "Missing RAILS_ROOT/db/seed.sql" |
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 'terminal-table/import' | |
class SubsetSumMatrix | |
class << self | |
def create_empty_for(array) | |
matrix = [] | |
header = [nil] + build_header_from(array) | |
matrix << header | |
array.each_with_index do |element,i| | |
row = header.collect{|value| 'F'} |
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
% Compiles mex files. | |
clc; clear all; cd mex; | |
% edit based on your installation folder | |
include = ' -I/Users/bneale/homebrew/Cellar/opencv/2.2/include/opencv -I/Users/bneale/homebrew/Cellar/opencv/2.2/include'; | |
lib = ' -L/Users/bneale/homebrew/Cellar/opencv/2.2/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy -lopencv_flann'; | |
% ========================================================================= | |
eval(['mex lk.cpp -O' include lib]); |
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 -e | |
# 2010-09-19 Marc Limotte | |
# Run continuously (every 30 minutes) as a cron. | |
# | |
# Looks for directories in HDFS matching a certain pattern and moves them to S3, using Amazon's new | |
# distcp replacement, S3DistCp. | |
# | |
# It creates marker files (_directory_.done and _directory_.processing) at the S3 destination, so |
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
# =================================================================================================================== | |
# Template for generating a no-frills Rails application with support for ElasticSearch full-text search via Tire | |
# =================================================================================================================== | |
# | |
# This file creates a basic, fully working Rails application with support for ElasticSearch full-text search | |
# via the Tire gem [http://github.com/karmi/tire]. | |
# | |
# You DON'T NEED ELASTICSEARCH INSTALLED, it is installed and launched automatically by this script. | |
# | |
# Requirements |
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
javascript:(function() { | |
if(!window.your_bookmarklet) { | |
var doc = document, | |
js = doc.createElement('script'); | |
js.type = 'text/javascript'; | |
js.src = 'loader.js'; | |
js.async = true; |
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
import com.edmunds.lead.thrift.gen.Address; | |
import com.edmunds.lead.thrift.gen.Contract; | |
import com.edmunds.lead.thrift.gen.Customer; | |
import com.edmunds.lead.thrift.gen.Lead; | |
import com.edmunds.lead.thrift.gen.Option; | |
import com.edmunds.lead.thrift.gen.Phone; | |
import com.edmunds.lead.thrift.gen.Subscription; | |
import com.edmunds.lead.thrift.gen.Tracking; | |
import com.edmunds.lead.thrift.gen.Vehicle; | |
import org.apache.hadoop.hbase.client.Result; |
OlderNewer