Skip to content

Instantly share code, notes, and snippets.

View jimneath's full-sized avatar

Jim Neath jimneath

View GitHub Profile
{"data":{"pricingTiers":[{"tierStem":"0","tierName":"Free","pricingInfo":[{"country":"United States","countryCode":"US","currencySymbol":"$","currencyCode":"USD","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"Canada","countryCode":"CA","currencySymbol":"$","currencyCode":"CAD","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"Mexico","countryCode":"MX","currencySymbol":"$","currencyCode":"MXN","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"Australia","countryCode":"AU","currencySymbol":"$","currencyCode":"AUD","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"New Zealand","countryCode":"NZ","currencySymbol":"$","currencyCode":"NZD","wholesalePrice":0.00,"retailPrice":0.00,"fRetailPrice":"$0.00","fWholesalePrice":"$0.00"},{"country":"Japan","countryCode":"JP","currencySymbol":"¥","currencyCode":"
if node[:ruby_version][/ruby 1\.9/i]
enable_package "media-gfx/imagemagick" do
version "6.7.8.8-r1"
end
package "media-gfx/imagemagick" do
version "6.7.8.8-r1"
action :install
end
# deploy.rb
namespace :ts_remote do
task :conf do
run <<-CMD
cd #{current_release}
&&
RAILS_ENV=#{rails_env} rake ts:conf
&&
rsync --progress #{current_release}/config/#{rails_env}.sphinx.conf sphinxsearch@db-server:/home/sphinxsearch/
@data = @competition.entries.
select('gender, COUNT(gender) AS count').
group('gender')
# I want the following:
#
# => [{ gender: 'female', count: 635 }, { gender: 'male', count: 432 }]
@jimneath
jimneath / broninrc
Created January 21, 2013 16:15
bronin
echo "It works"
for i in `find /data -maxdepth 1 -type d ! -name "monit.d" ! -name "nginx" ! -name "lost+found" ! -name "homedirs" ! -name "data"`;
do
appname=`echo ${i} | awk -F/ '{print $3}'`
version=''
if [ -f $i/current/Gemfile.lock ];
then
version=`egrep "^ *rails \([0-9\.]+\)" $i/current/Gemfile.lock | egrep -o "[0-9\.]+"`
else
version=`gem list | egrep -o "^rails \([^,\)]+" | egrep -o "[0-9\.]+"`
212.84.74.156 - - [01/Aug/2012:10:30:00 +0000] "GET /test/L6y2f0HpaH/tasks HTTP/1.0" 200 2500 "-" "Pingdom.com_bot_version_1.4_(http://www.pingdom.com)" "-" [start time: 1343817000289000]
82.11.130.247 - - [01/Aug/2012:10:30:01 +0000] "GET / HTTP/1.1" 200 1042 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11" "-" [start time: 1343817001781000]
173.248.147.18 - - [01/Aug/2012:10:31:00 +0000] "GET /test/L6y2f0HpaH/tasks HTTP/1.0" 200 2500 "-" "Pingdom.com_bot_version_1.4_(http://www.pingdom.com)" "-" [start time: 1343817060395000]
204.152.200.42 - - [01/Aug/2012:10:32:00 +0000] "GET /test/L6y2f0HpaH/tasks HTTP/1.0" 200 2500 "-" "Pingdom.com_bot_version_1.4_(http://www.pingdom.com)" "-" [start time: 1343817120361000]
95.211.87.85 - - [01/Aug/2012:10:33:00 +0000] "GET /test/L6y2f0HpaH/tasks HTTP/1.0" 200 2502 "-" "Pingdom.com_bot_version_1.4_(http://www.pingdom.com)" "-" [start time: 1343817180469000]
184.75.208.210 - - [01/Aug/2012:10:34
@jimneath
jimneath / gist:1988860
Created March 6, 2012 20:41
Post new review response
{
"response": {
"uuid": "7446FE77-E877-4836-A30F-69AD8C0Esff4761-55747-0000DA3697EFD3E7",
"review_uuid": "102fe9541253cddc638e40b9fdfb4bfb4be81c50c8de857c0280c4b126389b91503b88dc5890f8202c9d88aecdbf1a7d234ac9bbb2e666256b817d24",
"created_at": "2012-03-06 12:00:00",
"start_time": "2012-03-06 14:25:09",
"end_time": "2012-03-06 14:25:15",
"ratings_attributes": [
{
"rating_type": "Client Scores Competitor",
@jimneath
jimneath / gist:1988653
Created March 6, 2012 19:58
Post a new review
{
"review": {
"name": "Dasdasd",
"competitor_ids": [40, 5, 22, 13, 20],
"uuid": "039E44B7-9643-42A8-801D-8D53BB130573-44532-0000C4D78224DF74",
"created_at": "2012-03-05 21:57:08",
"client_id": 27
}
}
@jimneath
jimneath / config.ru
Created March 2, 2012 11:36
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
require "rails"