# rails:attachBindings
fired when jquery-rails starts attaching bindings to links, forms etc.
# confirm
gives you the opprotunity to skip a confirm dialog by returning a falsy value
# confirm:complete
Pingdom Traceroute from London | |
1 78.136.27.130 (78.136.27.130) 4.390 ms 4.558 ms 4.751 ms | |
2 core5a-aggr312a.lon3.rackspace.net (92.52.76.122) 0.491 ms 0.502 ms 0.548 ms | |
3 vl911.edge3.lon3.rackspace.net (92.52.76.196) 1.159 ms 1.220 ms 1.276 ms | |
4 ldn-b4-link.telia.net (213.248.85.201) 0.955 ms 0.981 ms 1.029 ms | |
5 cogent-ic-125507-ldn-b4.c.telia.net (213.248.70.238) 1.948 ms 2.037 ms 2.147 ms | |
6 te2-1.3493.mpd02.lon01.atlas.cogentco.com (130.117.2.18) 1.802 ms 1.622 ms te1-8.ccr01.lon01.atlas.cogentco.com (130.117.3.226) 32.614 ms | |
7 te3-3.ccr02.lon02.atlas.cogentco.com (130.117.48.154) 1.772 ms 1.880 ms 1.930 ms | |
8 te3-8.ccr02.ams03.atlas.cogentco.com (130.117.0.33) 9.154 ms 9.145 ms 9.141 ms |
--- Sources/TTPhotoView.m (revision 175) | |
+++ Sources/TTPhotoView.m (working copy) | |
@@ -293,6 +293,7 @@ | |
- (void)loadImage { | |
if (_photo) { | |
_photoVersion = TTPhotoVersionLarge; | |
+ self.defaultImage = self.image; | |
self.urlPath = [_photo URLForVersion:TTPhotoVersionLarge]; | |
} | |
} |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Page Not Found :(</title> | |
<style> | |
body { text-align: center;} | |
h1 { font-size: 50px; text-align: center } | |
span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; } | |
body { font: 20px Constantia, 'Hoefler Text', "Adobe Caslon Pro", Baskerville, Georgia, Times, serif; color: #999; text-shadow: 2px 2px 2px rgba(200, 200, 200, 0.5); } |
function rap { | |
if [ "$1x" = "x" ]; then | |
echo "rap - shortcut to rake assets:precompile" | |
echo " usage rap [rails env]" | |
else | |
rake assets:clean assets:precompile RAILS_ENV=$1 | |
fi | |
} |
<% | |
manifest = {} | |
app = Rails.application | |
env = app.assets | |
env.each_logical_path do |logical_path| | |
if File.basename(logical_path)[/[^\.]+/, 0] == 'index' | |
logical_path.sub!(/\/index\./, '.') | |
end | |
# grabbed from Sprockets::Environment#find_asset |
# example | |
# | |
# States = enum %w(Draft Approved Published Trashed) | |
# => States {Draft, Approved, Published, Trashed} | |
# | |
# States::Draft | |
# => 1 | |
# | |
# States::Approved | |
# => 2 |
(function(){ | |
var fb_root; | |
$(document).on('page:fetch', function(){ | |
// store a ref to the fb-root element before changing the page | |
fb_root = $("#fb-root"); | |
}); | |
$(document).on('page:change', function(){ | |
// put back the fb-root element |
function parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /' | |
} | |
function get_git_color() { | |
isred=`git status -s 2> /dev/null | egrep "^.[^? ]" | wc | awk '{print $1}'` | |
isorange=`git status -s 2> /dev/null | egrep "^[^? ]" | wc | awk '{print $1}'` |
# rails:attachBindings
fired when jquery-rails starts attaching bindings to links, forms etc.
# confirm
gives you the opprotunity to skip a confirm dialog by returning a falsy value
# confirm:complete
#!/usr/bin/env ruby | |
require 'yaml' | |
require 'active_support' | |
RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/../') | |
files = Dir.glob("#{RAILS_ROOT}/config/locales/*.yml") | |
locales = files.map{|f| File.basename(f, '.yml')} | |
def flat_hash(hash, k = nil) |