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 BooleanValue | |
# https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/column.rb#L8 | |
FALSE_VALUES = [false, 0, '0', 'f', 'F', 'false', 'FALSE', 'off', 'OFF'] | |
def self.from_string(value) | |
Rails.present? ? with_rails(value) : without_rails(value) | |
end | |
private |
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
### Keybase proof | |
I hereby claim: | |
* I am alistairholt on github. | |
* I am alistairholt (https://keybase.io/alistairholt) on keybase. | |
* I have a public key whose fingerprint is 5864 8D16 40D9 BB22 BD78 6702 B27D 505C 5E6A 44B7 | |
To claim this, I am signing this object: |
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
pgdrop() { | |
RAILS_ENV=$1 | |
: ${RAILS_ENV:="development"} | |
RUBY_SCRIPT=$(cat <<SCRIPT | |
db_config_path = File.expand_path("config/database.yml", Dir.getwd) | |
abort 'NO_CONFIG' unless File.exists?(db_config_path) | |
db_config = YAML.load(File.open(db_config_path))["$RAILS_ENV"] | |
abort 'NO_POSTGRES' unless db_config["adapter"] == "postgresql" | |
abort db_config["database"] | |
SCRIPT) |
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
# Example: UIPanGestureRecognizer on a single UIView | |
class FooViewController < UIViewController | |
def loadView | |
# View | |
self.view = UIView.alloc.init | |
# Block | |
blockFrame = CGRectMake(100,100,100,100) | |
block = UIView.alloc.initWithFrame(blockFrame) |
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
#foo { | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-box; | |
display: -webkit-flex; | |
display: box; | |
display: flex; | |
-webkit-box-orient: vertical; | |
-moz-box-orient: vertical; | |
-o-box-orient: vertical; |
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 () { | |
$.jribbble.getShotsByPlayerId('ryanAmurphy', function (playerShots) { | |
var html = ''; | |
$.each(playerShots.shots, function (i, shot) { | |
html += '<li><h3>' + shot.title + '</h3>'; | |
html += '<h4>by ' + shot.player.name + '</h4><a href="' + shot.url + '">'; | |
html += '<img src="' + shot.image_teaser_url + '" '; | |
html += 'alt="' + shot.title + '"></a></li>'; | |
}); |
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
#foo { | |
background: -webkit-gradient(linear, 0% 0%, 100% 0%, from(#EFF6F5), color-stop(0.02, #C6E2DF), color-stop(0.5, #C6E2DF), color-stop(0.98, #C6E2DF), to(#EFF6F5)); | |
background: -webkit-linear-gradient(0deg, #EFF6F5, #C6E2DF 2%, #C6E2DF 50%, #C6E2DF 98%, #EFF6F5); | |
background: -moz-linear-gradient(0deg, #EFF6F5, #C6E2DF 2%, #C6E2DF 50%, #C6E2DF 98%, #EFF6F5); | |
background: -o-linear-gradient(0deg, #EFF6F5, #C6E2DF 2%, #C6E2DF 50%, #C6E2DF 98%, #EFF6F5); | |
background: linear-gradient(0deg, #EFF6F5, #C6E2DF 2%, #C6E2DF 50%, #C6E2DF 98%, #EFF6F5); | |
} |
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
Process: CoverSutra [2946] | |
Path: /Applications/CoverSutra.app/Contents/MacOS/CoverSutra | |
Identifier: com.sophiestication.CoverSutra | |
Version: 2.2 Beta 6 (220b6) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [298] | |
Date/Time: 2009-09-20 20:46:50.608 +0100 | |
OS Version: Mac OS X 10.6.1 (10B504) | |
Report Version: 6 |
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
Process: CoverSutra [2946] | |
Path: /Applications/CoverSutra.app/Contents/MacOS/CoverSutra | |
Identifier: com.sophiestication.CoverSutra | |
Version: 2.2 Beta 6 (220b6) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [298] | |
Date/Time: 2009-09-20 20:46:50.608 +0100 | |
OS Version: Mac OS X 10.6.1 (10B504) | |
Report Version: 6 |
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
/!\ FAILSAFE /!\ Sat Aug 15 16:09:30 +0100 2009 | |
Status: 500 Internal Server Error | |
Invalid JSON string | |
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/json/backends/yaml.rb:18:in `decode' | |
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/json/decoding.rb:11:in `__send__' | |
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/json/decoding.rb:11:in `decode' | |
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/params_parser.rb:42:in `parse_formatted_parameters' | |
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/params_parser.rb:11:in `call' | |
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/session/cookie_store.rb:93:in `call' | |
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_controller/reloader.rb:29:in `call' |
NewerOlder