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 Left | |
include Mongoid::Document | |
field :title, :type => String | |
has_and_belongs_to_many :rights | |
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
# http://forums.shopify.com/categories/6/posts/42926 | |
# This is a fairly simple mechanize script to create a few hundred or so shopify discounts from a CSV of groupon codes. | |
# You'll want to change all of the "changeme" values to your own. | |
# The script expects there to be a groupon_codes.csv in the same directory. | |
# | |
# The groupons_code.csv should look like this: | |
# 8m7677 | |
# 8m6749 | |
# 8m5398 | |
# 8m7699 |
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 'fog' | |
require 'yaml' | |
Message = Struct.new(:idx, :body, :sent_at) | |
@lorem = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' | |
# You need to create an amazon aws account to setup an SQS queue and get the access and secret key. | |
QUEUE_URL = 'https://queue.amazonaws.com/446249531791/test_queue' | |
ACCESS_KEY = 'change_me' |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2359777/hack.sh | sh | |
# |
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
warning: vim.googlecode.com certificate with fingerprint 65:a0:a7:8d:8f:48:eb:13:5c:81:3c:47:2d:6b:73:c4:7e:ea:61:5f not verified (check hostfingerprints or web.cacerts config setting) | |
clang: warning: argument unused during compilation: '-no-cpp-precomp' | |
clang: warning: argument unused during compilation: '-no-cpp-precomp' | |
Undefined symbols for architecture x86_64: | |
"_ruby_errinfo", referenced from: | |
_error_print in if_ruby.o | |
ld: symbol(s) not found for architecture x86_64 | |
clang: error: linker command failed with exit code 1 (use -v to see invocation) | |
make[1]: *** [vim] Error 1 | |
make: *** [first] Error 2 |
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 example of using the NSCodable module. | |
class Post | |
include NSCodable | |
attr_accessor :id, :message | |
end | |
# Create a new post. | |
post = Post.new(:id => 4, :message => 'Some random message') |
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
# List of environments and their heroku git remotes | |
ENVIRONMENTS = { | |
:staging => 'myapp-staging', | |
:production => 'myapp-production' | |
} | |
namespace :deploy do | |
ENVIRONMENTS.keys.each do |env| | |
desc "Deploy to #{env}" | |
task env do |
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
# The only true solution to the "Turn this array into a snake" test. | |
class Array | |
def motherfucking_spiral | |
[ 1, 2, 3, 4, | |
12, 13, 14, 5, | |
11, 16, 15, 6, | |
10, 9, 8, 7 ] | |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2EG5UiCIn4e/iECf3K5IwJsXwtSz0qZ1fXXlvUVvF4hHfsWOeX4vXqtX4jLiu1h1Zpyqa0bJeXtkQDF3U/aT+Ez/Y6qBBo5ONdkAsNHWdmYvfkcQ+HBCd3HSd3nGjR1xTShZbEWakCt/yO+tSw7HWgIgQYVPJ+kHvfkBvw10Z7aLc3+WM0Hg8BmQIl6YKLKzhEQjdq1x81Q6OKMO5Vqmb61eE8TSr+ISEqzUjg9gAkT3qyF0CegXw0b3/wIpvhtCpYh9QpWi87JqMfWqNvARH4ciIcj+T/6HeB+aOVhtYv5Q+X84GcyNBErbYqFfzbomAgeqzv2Ag+kIUfNrJSfwF rapind@rapindesk |
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
<script> | |
window.onload = function() { | |
parent.postMessage('height:' + document.body.scrollHeight, "*"); | |
}; | |
</script> |
OlderNewer