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
this is a gist |
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 'builder' |
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
Started GET "/products/die-cut-stickers" for 127.0.0.1 at 2014-11-19 12:47:59 -0500 | |
Processing by Spree::ProductsController#show as HTML | |
Parameters: {"id"=>"die-cut-stickers"} | |
Spree::Preference Load (0.4ms) SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = 'spree/frontend_configuration/locale' LIMIT 1 | |
Spree::User Load (0.3ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."deleted_at" IS NULL AND "spree_users"."id" = 1 ORDER BY "spree_users"."id" ASC LIMIT 1 | |
Spree::Store Load (0.3ms) SELECT "spree_stores".* FROM "spree_stores" WHERE (url like '%rockin-stickers.dev%') ORDER BY "spree_stores"."id" ASC LIMIT 1 | |
Spree::Store Load (0.3ms) SELECT "spree_stores".* FROM "spree_stores" WHERE "spree_stores"."default" = 't' ORDER BY "spree_stores"."id" ASC LIMIT 1 | |
Spree::Order Load (0.4ms) SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."completed_at" IS NULL AND "spree_orders"."currency" = 'USD' AND "spree_orders"."guest_ |
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
# Open a project interactively | |
unbind C-p | |
bind-key C-p \ | |
command-prompt -p "client:","project:" "\ | |
new-session -A -c ~/Projects/%1/%2 -s %2 -n code 'reattach-to-user-namespace -l vim'\;\ | |
new-window -d -n console 'tail -f log/development.log'\;\ | |
split-window -v -t 1 'rails c'\;\ | |
next-window" |
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
class StringJoiner | |
def call string1, string2 | |
"#{string1}#{string2}" | |
end | |
end | |
join = StringJoiner.new | |
join.call("this ", "is normal") | |
# => "this is normal" |
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
array = [{:stat1 => 34, :stat2 => 37}, {:stat1 => 45, :stat2 => 78}] | |
total = {} | |
array.each do |element| | |
element.each do |key, val| | |
total[key] ||= 0 | |
total[key] += val | |
end | |
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
#! /usr/bin/ruby | |
# This little guy will download and save all the URLs it can find from the file it retrieves from a | |
# given URL. Works awesomely for Apache index pages of lots of image files. Like http://bukk.it |
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 | |
T.DateOpenedUTC | |
,C.DataContent | |
,T.subject | |
FROM st_Tickets T | |
LEFT JOIN st_CustomDataFieldsInTickets C | |
ON (T.TicketID = C.TicketID) | |
LEFT JOIN ( | |
SELECT <fourth column here>, Tin.TicketID |
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
chuck@chuck:~/Sites/fastfill → ruby-1.9.2-p290@fastfill → master $ brew install memcached | |
==> Installing memcached dependency: libevent | |
==> Downloading http://monkey.org/~provos/libevent-2.0.12-stable.tar.gz | |
######################################################################## 100.0% | |
==> ./configure --prefix=/usr/local/Cellar/libevent/2.0.12 | |
==> make install | |
/usr/local/Cellar/libevent/2.0.12: 47 files, 1.9M, built in 37 seconds | |
==> Installing memcached | |
==> Downloading http://memcached.googlecode.com/files/memcached-1.4.6.tar.gz | |
######################################################################## 100.0% |
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/sh | |
# Just copy and paste the lines below | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
cd `brew --prefix` | |
git ls-files -z | pbcopy | |
rm -rf Cellar | |
bin/brew prune | |
pbpaste | xargs -0 rm | |
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions |
OlderNewer