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
# stolen from http://gist.github.com/119874 and made a tiny bit more robust by me | |
# this implementation uses haml by default. if you want to use any other template mechanism | |
# then replace `erb` on line 23 and line 31 with `erb` or whatever | |
#This implementation varies from lenary's because it allows a :spacer_string to be specified | |
# a spacer_string works the same way as a :spacer_template in rails, | |
# except instead of rendering a page it plops in a string, | |
# but only in between elements of the collection, not at the end. | |
# This is useful if you have, say, a collection of blog tags, | |
# rendered as a collection of links with commas between them. |
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
BlockDomains( | |
'youtube.com' => %w[ | |
72.14.213.100 | |
72.14.213.101 | |
72.14.213.102 | |
72.14.213.113 | |
72.14.213.138 | |
72.14.213.139 | |
74.125.127.100 | |
74.125.127.101 |
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 {{key}} interpolation syntax in I18n messages is deprecated. Please use %{key} instead. | |
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:162:in `interpolate' | |
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:157:in `gsub' | |
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:157:in `interpolate' | |
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:197:in `preserve_encoding' | |
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:156:in `interpolate' | |
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:49:in `translate' | |
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n.rb:152:in `translate' | |
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:120:in `resolve' | |
/Library/Ruby/Gems/1.8/gems/i18n-0.4.1/lib/i18n/backend/base.rb:105:in `default' |
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
MongoDB browser shell version: 0.1.3 | |
connecting to random database | |
type "contest" to learn how to enter to win a MongoDB mug or backpack! | |
type "tutorial" to start the MongoDB tutorial | |
> contest | |
10gen is giving away MongoDB mugs and backpacks. | |
To enter the giveaway, simply save your contact information to the | |
'info' collection. For example, to save your name and email address, you'd enter: | |
db.info.save({name: "Meghan", email: "[email protected]"}) |
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 sample Guardfile | |
# More info at https://github.com/guard/guard#readme | |
guard 'minitest' do | |
# with Minitest::Unit | |
watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" } | |
watch(%r{^test/.+_test\.rb$}) | |
watch('test/test_helper.rb') { "test" } | |
# Rails example |
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
# More info at https://github.com/guard/guard#readme | |
guard 'minitest' do | |
# with Minitest::Unit | |
watch(%r{^lib/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" } | |
watch(%r{^test/.+_test\.rb$}) | |
watch('test/test_helper.rb') { "test" } | |
# Rails example | |
watch(%r{^app/models/(.+)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" } |
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
$("*[contenteditable]").live({ | |
blur: function(){ | |
var model = $(this).attr("data-model"), | |
attribute = $(this).attr("data-attribute") || $(this).attr("class"), | |
value = $(this).text(), | |
path = $(this).attr("data-path"), | |
updateData = {}; | |
updateData[model] = {}; | |
updateData[model][attribute] = value; | |
$.ajax({ |
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
TITLEBAR="\[\e]0;\u@\h \w\007\]" | |
export PS1='\[\e]0;\u@\h \w\007\]\ | |
\[\e[0;32m\]\u@\h\[\e[0m\] \ | |
\[\e[1;34m\]\w\[\e[0m\]\ | |
\[\e[1;35m\]$(__git_ps1)\[\e[0m\] \ | |
\[\e[1;37m\]$\[\e[0m\] ' |
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 'spec_helper' | |
require 'carrierwave/test/matchers' | |
describe CoverArtUploader do | |
include CarrierWave::Test::Matchers | |
before do | |
CoverArtUploader.enable_processing = true | |
@uploader = CoverArtUploader.new(CoverArt.create, :image) | |
@uploader.store!(File.open("#{Rails.root}/spec/uploaders/fruit.jpg", "r")) |
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
# encoding: utf-8 | |
class CoverArtUploader < CarrierWave::Uploader::Base | |
# Include RMagick or ImageScience support: | |
# include CarrierWave::RMagick | |
# include CarrierWave::ImageScience | |
# Choose what kind of storage to use for this uploader: | |
# storage :file |
OlderNewer