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
<!-- for some reason this isn't receiving my style! --> | |
<pee class="tl-body viewsource"><%= foo.bar %></pre> |
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
# /path/to/seinfeld/app/config.ru | |
require 'rubygems' | |
require 'rack' | |
require 'sinatra' | |
Sinatra::Application.default_options.update( | |
:run => false, | |
:env => :production, | |
# nfi why this is needed, shouldn't it pick up the pwd??? | |
:views => '/path/to/seinfeld/app/views', |
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
module TokenGenerator | |
@@chars = (('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0) | |
@@char_size = @@chars.size | |
extend self | |
def generate_simple | |
(1..8).collect { |a| @@chars[rand(@@char_size)] }.join | |
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
<% @changes.select(&:diffable?).each do |change| -%> | |
<% begin -%> | |
<%= diff_for change %> | |
<% rescue -%> | |
? | |
<% 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
# fuck you for judging me! LOL | |
class << ActiveRecord::Base | |
def second(options = {}) | |
first(options.update(:offset => 1)) | |
end | |
def third(options = {}) | |
first(options.update(:offset => 2)) | |
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
class << ActiveRecord::Base | |
def none?(*args) | |
!exists?(*args) | |
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
module MyApp | |
class TestCase < Test::Unit::TestCase | |
def self.transaction(&block) | |
Sequel::Model.db.transaction &block | |
end | |
def transaction(&block) | |
self.class.transaction(&block) | |
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
gem 'activesupport', '~> 2.1.1' | |
gem 'sequel', '~> 2.7' | |
gem 'activemerchant', '~> 1.4' | |
%w(array/extract_options hash/keys hash/indifferent_access).each { |lib| require "active_support/core_ext/#{lib}" } | |
class Array #:nodoc: | |
include ActiveSupport::CoreExtensions::Array::ExtractOptions | |
end | |
class Hash #:nodoc: |
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
module ThinkingSphinx | |
def self.index_documents_in_testing | |
ThinkingSphinx::Deltas::Job.cancel_thinking_sphinx_jobs | |
config = ThinkingSphinx::Configuration.instance | |
config.build | |
FileUtils.mkdir_p config.searchd_file_path | |
cmd = "#{config.bin_path}indexer --config #{config.config_file} --all" | |
cmd << " --rotate" if ThinkingSphinx.sphinx_running? |
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
~vp(master)> cat ~/.gitconfig | |
...SNIP... | |
[alias] | |
datetag = !git tag `date \"+%Y%m%d%H%M\"` | |
update = pull --rebase | |
commdiff = log --pretty=oneline --left-right | |
...SNIP... | |
~vp(master)> git commdiff master...staging | |
>bb569b9a8c70a61ecffd4def3ac5e460848e0f36 Merge branch 'master' into staging | |
>f95b7db13fb48b3b5e1c2c484d00909a89f468d5 bulk edit on search page is no longer experimental |
OlderNewer