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
#!/usr/bin/env ruby | |
if remote = `git remote -v`.lines.find { |l| l.match /bitbucket/ } | |
matches = remote.match /(?<domain>bitbucket.org).(?<path>.*)\.git/ | |
url = "https://#{matches[:domain]}/#{matches[:path]}" | |
branch = `git symbolic-ref --short HEAD`.lines.first | |
url += "/branch/#{branch}" | |
system "open #{url}" |
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 'test_helper' | |
module CallbackModelTemplate | |
def self.included(model) | |
model.class_eval do | |
key :name, String | |
has_many :sons, :class_name => 'CallbacksTest::Son' | |
[ :before_validation_on_create, :before_validation_on_update, | |
:before_validation, :after_validation, |
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
context "new?" do | |
setup do | |
@document.class_eval do | |
key :foo, Address | |
end | |
end | |
should "be new until document is saved" do | |
address = Address.new(:city => 'South Bend', :state => 'IN') | |
doc = @document.new(:foo => address) |
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 is an incomplete implementation. | |
module MongoMapper | |
module NestedAttributes | |
def self.included(base) | |
base.extend(ClassMethods) | |
base.send :include, InstanceMethods | |
end | |
module ClassMethods | |
def accepts_nested_attributes_for(*attr_names) |
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 UI CSS Framework | |
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) | |
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. | |
*/ | |
/* Layout helpers | |
----------------------------------*/ | |
.ui-helper-hidden { display: none; } | |
.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } |
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
G D/F# Em | |
She said I don't know if I've ever been good enough | |
C2 G D/F# Em C2 | |
I'm a little bit rusty, and I think my head is caving in | |
G D/F# Em | |
And I don't know if I've ever been really loved | |
C2 G D/F# Em | |
By a hand that's touched me, and I feel like somethings gonna give | |
C2 | |
And I'm a little bit angry |
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
# Zef Houssney | |
# http://madebykiwi.com | |
# | |
# rb-appscript documentation: | |
# http://appscript.sourceforge.net/rb-appscript/index.html | |
# | |
# Install rb-appscript with: | |
# sudo gem install rb-appscript | |
# Make sure to backup your address book before doing this!!! |
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
tell application "System Events" | |
set app_name to name of the first process whose frontmost is true | |
set visible of process app_name to false | |
end tell | |
tell application "Finder" | |
activate | |
end tell |
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
app.QWERTY_COORDINATES = { | |
"~": [35, 120], | |
"`": [35, 120], | |
"1": [90, 120], | |
"!": [90, 120], | |
"2": [144, 120], | |
"@": [144, 120], | |
"3": [198, 120], | |
"#": [198, 120], | |
"4": [253, 120], |
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
# A jQuery Wrapper around spin.js | |
# Has sane defaults and uses the color attribute of the target selector | |
# | |
# http://fgnass.github.com/spin.js/ | |
# | |
# preset_name - size of spinner: 'small' or 'large' | |
# customizations - any option from spin.js | |
# | |
# Examples: | |
# |
OlderNewer