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
function intuitRespondHandler(response) { | |
console.log("handling") | |
console.log(response) | |
var $form = $('#payment-form'); | |
var $payment_errors = $form.find('.payment-errors') | |
if (response.value) { | |
$payment_errors.hide().text(''); |
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
module MyApp | |
class Application < Rails::Application | |
if Rails.env == 'test' | |
require 'diagnostic' | |
config.middleware.use(MyApp::DiagnosticMiddleware) | |
end | |
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
echo "Show all extensions" | |
defaults write NSGlobalDomain AppleShowAllExtensions -bool true | |
echo "Require password immediately after sleep or screen saver begins" | |
defaults write com.apple.screensaver askForPassword -int 1 | |
defaults write com.apple.screensaver askForPasswordDelay -int 0 | |
echo "Disable the Ping sidebar in iTunes" | |
defaults write com.apple.iTunes disablePingSidebar -bool 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
# This assumes you have the fields first_name, last_name and company_name on your model User. | |
# | |
# If there's a simpler way to do this please let me know. The issue was mostly with how MySQL | |
# sorts null values. If you have your order clause as "order by company_name, last_name" then | |
# columns with company_name that have null would be first which you don't want, you want it | |
# to use the value for last_name instead. You could also do this all in memory in Ruby but | |
# when you are also paginating it's easy enough to get your hands dirty with some SQL. | |
# app/models/user.rb | |
named_scope :sorted, :order => "sort_name, first_name ASC", |
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
function clinstall(){ | |
echo "Cloning repository, cd'ing into it and running bundle install..." | |
filename=$(basename $1) | |
filename=${filename%.*} | |
git clone $1 && cd "$filename" && bundle install | |
} |
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
# if you look in clearance/lib/clearance/user.rb you can see the encryption method | |
# | |
# def encrypt(string) | |
# generate_hash("--#{salt}--#{string}--") | |
# end | |
# | |
# lib/clearance_crypto.rb | |
class ClearanceCrypto | |
def self.encrypt(*tokens) | |
Digest::SHA1.hexdigest("--#{tokens[1]}--#{tokens[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
<h1>The largest header is an h1</h1> | |
<p> | |
Ut lacus lacus, hendrerit id tincidunt vel, posuere ac lorem. Donec posuere sem sed est vestibulum commodo ut vel nunc. Nunc placerat, lorem a pharetra aliquet, nunc lacus facilisis nibh, in ultricies metus sapien eu augue. Nullam quis neque magna. Ut at metus tellus. Nullam vehicula hendrerit ligula vitae iaculis. </p> | |
<h2>Next we have an h2</h2> | |
<p> | |
Here's a paragraph with a <a>link to nowhere</a>. Lorem a pharetra aliquet, nunc lacus facilisis nibh, in ultricies metus sapien eu augue. Nullam quis neque magna. Ut at metus tellus. Nullam vehicula hendrerit ligula vitae iaculis. Also, something <strong>that is bolded</strong> and also an <em>emphasized phrase</em>.</p> |