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 | |
require 'benchmark' | |
require 'rubygems' | |
require 'active_support/core_ext/string/inflections' # v4.1.4 | |
require 'lotus/utils/class' # v0.2.0 | |
TIMES = (ENV['TIMES'] || 1_000_000).to_i | |
class Foo | |
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
require 'test_helper' | |
class JslintTest < ActionDispatch::IntegrationTest | |
include ActionView::Helpers::JavaScriptHelper | |
['file1', 'file2', 'file3'].each do |path| | |
path.gsub!(/^app\/assets\/javascripts\//, "") | |
path += '.js' | |
test "JSLINT #{path}" do | |
assert_jslint(path) |
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
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/htpasswd; |
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
framework 'Cocoa' | |
framework 'avfoundation' | |
class Santa | |
t_url = NSURL.URLWithString("http://dl.dropbox.com/u/349788/mustache.png") | |
t_source = CGImageSourceCreateWithURL t_url, nil | |
@@tache = CGImageSourceCreateImageAtIndex t_source, 0, nil | |
g_url = NSURL.URLWithString("http://dl.dropbox.com/u/349788/glasses.png") | |
g_source = CGImageSourceCreateWithURL g_url, nil |
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
Dear soon-to-be-former user, | |
We've got some fantastic news! Well, it's great news for us anyway. You, on | |
the other hand, are fucked. | |
We've just been acquired by: | |
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
framework 'Cocoa' | |
framework 'avfoundation' | |
class Santa | |
t_url = NSURL.URLWithString("http://dl.dropbox.com/u/349788/mustache.png") | |
t_source = CGImageSourceCreateWithURL t_url, nil | |
@@tache = CGImageSourceCreateImageAtIndex t_source, 0, nil | |
g_url = NSURL.URLWithString("http://dl.dropbox.com/u/349788/glasses.png") | |
g_source = CGImageSourceCreateWithURL g_url, nil |
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
# before this file is loaded, a locale should be set: | |
# | |
# In a browser environment, you can use: | |
# ```<script>__locale='en';</script>``` | |
# | |
# In a server environment (specifically node.js): | |
# ```global.__locale = 'en';``` | |
# normalize in-app locale string to "en" or "de-AT" | |
parts = @__locale.split('-') |
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
# Add this to your spec_helper.rb | |
RSpec.configure do |config| | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.around(:each, :vcr) do |example| | |
name = example.metadata[:full_description].downcase.gsub(/\W+/, "_").split("_", 2).join("/") | |
VCR.use_cassette(name, :record => :new_episodes) do | |
example.call | |
end | |
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
# add this to your spec helper | |
RSpec.configure do |config| | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.filter_run :focus => true | |
config.run_all_when_everything_filtered = true | |
end | |
# and then use the :focus tag in your specs | |
it "does something awesome", :focus 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
gem 'rails', '3.1.0.rc5' | |
# Gems used only for assets and not required | |
# in production environments by default. | |
group :assets do | |
gem 'sass', '3.1.5' # <= downgraded due to a weird interaction b/w compass blueprint and latest Sass | |
gem 'sass-rails', "~> 3.1.0.rc" | |
gem 'coffee-rails', "~> 3.1.0.rc" | |
gem 'uglifier' | |
gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31' |
NewerOlder