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
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' |
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 'ostruct' | |
Wiki = OpenStruct.new | |
Wiki.name = "Perwikity" | |
Wiki.description = "An elegant wiki system for anyone who respects their grandmother" | |
Wiki.license_line = "© 2009 Your Own Organization : This stuff might also be Creative Commons" | |
Wiki.allow_anonymous_create = true | |
Wiki.allow_anonymous_edit = true | |
Wiki.allow_anonymous_revert = true |
NewerOlder