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 | |
# --------------------------------------------------------------------------- | |
# OO support functions | |
# Kludged by Pim van Riezen <[email protected]> | |
# --------------------------------------------------------------------------- | |
DEFCLASS="" | |
CLASS="" | |
THIS=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/bash | |
AUTH="user:password" | |
BASE="http://url.com/" | |
METHOD=$1 | |
DEST="$BASE$2" | |
XML=$3 | |
# or | |
# JSON=$3 | |
# make sure args were passed |
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
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
run "rm -f public/javascripts/*" | |
# Download JQuery | |
run "curl -L http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js > public/javascripts/jquery.js" | |
run "curl -L http://jqueryjs.googlecode.com/svn/trunk/plugins/form/jquery.form.js > public/javascripts/jquery.form.js" |
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 'rubygems' | |
require 'eventmachine' | |
require 'em-http' # gem install em-http-request | |
require 'yajl' # gem install yajl-ruby | |
class String | |
def bold | |
"\033[1m#{self}\033[0m" | |
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
=> Booting WEBrick | |
=> Rails 3.0.6 application starting in development on http://0.0.0.0:3000 | |
=> Call with -d to detach | |
=> Ctrl-C to shutdown server | |
[2011-04-08 12:13:22] INFO WEBrick 1.3.1 | |
[2011-04-08 12:13:22] INFO ruby 1.9.2 (2010-12-25) [x86_64-linux] | |
[2011-04-08 12:13:22] INFO WEBrick::HTTPServer#start: pid=6213 port=3000 | |
cache: [GET /refinery/] miss | |
cache: [GET /refinery/] miss |
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
# [DEVISE] From version 1.2, there is no need to set your encryptor to | |
# bcrypt since encryptors are only enabled if you include :encryptable | |
# in your models. To update your app, please: | |
# 1) Remove config.encryptor from your initializer; | |
# 2) Add t.encryptable to your old migrations; | |
# 3) [Optional] Remove password_salt in a new recent migration. Bcrypt | |
# does not require it anymore. | |
# $ rails g migration AddEncryptableToUsers |
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
OrderMailer.class_eval do | |
def confirm(order, resend = false) | |
@subject = (resend ? "[RESEND] " : "") | |
@subject += Spree::Config[:site_name] + ' ' + 'Order Confirmation #' + order.number | |
@body = {"order" => order} | |
@recipients = order.email | |
@from = Spree::Config[:order_from] | |
@bcc = order_bcc | |
@sent_on = Time.now | |
@content_type = "multipart/mixed" |
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 Heroku::Command::Sendgrid < Heroku::Command::Base | |
def test_email | |
app = extract_app | |
vars = heroku.config_vars(app) | |
to = '' | |
args.each do |arg| | |
key, value = arg.split("=") | |
to = value if key == "to" | |
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
# See also: | |
# Fine-tuning tab completion in Bash, | |
# http://codesnippets.joyent.com/posts/show/1690 | |
export PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
export IFS=$' \t\n' | |
help fc |
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
jQuery(function () { | |
var cache = {}, | |
url = "/posts/autocomplete", | |
lastXhr; | |
jQuery("#SearchFormInputId").autocomplete({ | |
minLength: 2, | |
delay: 125, | |
html: true, | |
source: function(request, response) { | |
var term = request.term; |