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
activerecord (3.0.5) lib/active_record/base.rb:1321:in `sanitize_sql_array' | |
activerecord (3.0.5) lib/active_record/base.rb:1224:in `sanitize_sql' | |
activerecord (3.0.5) lib/active_record/relation/query_methods.rb:224:in `send' | |
activerecord (3.0.5) lib/active_record/relation/query_methods.rb:224:in `build_where' | |
activerecord (3.0.5) lib/active_record/relation/query_methods.rb:77:in `where' | |
activerecord (3.0.5) lib/active_record/relation/spawn_methods.rb:118:in `apply_finder_options' | |
activerecord (3.0.5) lib/active_record/relation/finder_methods.rb:101:in `find' | |
activerecord (3.0.5) lib/active_record/base.rb:439:in `__send__' | |
activerecord (3.0.5) lib/active_record/base.rb:439:in `find' | |
app/controllers/categories_controller.rb:19:in `show' |
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 User < ActiveRecord::Base | |
attr_accessor :password | |
before_save :encrypt_password | |
validates :password, :presence => { :message => "cannot be blank" }, :confirmation => true | |
validates :email, :presence => { :message => "cannot be blank" }, :uniqueness => true, :format => { :with => /^.+@.+\..+$/, :on => :create } | |
7 | |
def encrypt_password | |
if password.present? | |
self.password_salt = BCrypt::Engine.generate_salt |
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
bgeiger@siwoti-rails:~/src/RailsSites$ rvm gemset copy global ProjectNameCopying gemset from global to ProjectName | |
Making gemset for ProjectName pristine. | |
WARN: ruby ruby-1.8.7-p334-ProjectName is not installed. | |
To install do: 'rvm install ruby-1.8.7-p334-ProjectName' | |
ERROR: Error running 'rvm gemset pristine' under , | |
please read /home/bgeiger/.rvm/log/ruby-1.8.7-p334/gemset.pristine.log | |
bgeiger@siwoti-rails:~/src/RailsSites$ cat /home/bgeiger/.rvm/log/ruby-1.8.7-p334/gemset.pristine.log | |
[2011-05-25 14:35:44] rvm gemset pristine # under ProjectName | |
ERROR: While executing gem ... (NameError) |
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
" Configure pathogen | |
call pathogen#runtime_append_all_bundles() | |
" Default color scheme | |
colorscheme vividchalk | |
highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE | |
" General | |
let mapleader="," | |
let g:mapleader="," |
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
bgeiger@siwoti-rails:~/src/nifty-generators$ rake --trace | |
WARNING: Global access to Rake DSL methods is deprecated. Please include | |
... Rake::DSL into classes and modules which use the Rake DSL methods. | |
WARNING: DSL method Cucumber::Rake::Task#desc called at /home/bgeiger/.rvm/gems/ruby-1.9.2-p180@nifty-generators/gems/cucumber-0.9.4/lib/cucumber/rake/task.rb:140:in `define_task' | |
WARNING: DSL method Cucumber::Rake::Task#task called at /home/bgeiger/.rvm/gems/ruby-1.9.2-p180@nifty-generators/gems/cucumber-0.9.4/lib/cucumber/rake/task.rb:141:in `define_task' | |
** Invoke default (first_time) | |
** Invoke features (first_time) | |
** Execute features | |
rake aborted! | |
uninitialized constant Cucumber::Rake::Task::ForkedCucumberRunner::RUBY |
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
<html> | |
<head> | |
<title>Porcupine Options</title> | |
</head> | |
<script src="jquery.js" type="text/javascript" /> | |
<script type="text/javascript"> | |
function restore_blocklist() { | |
//var blocklist = localStorage["porcupine-blocklist"]; | |
var blocklist = [ "foo", "bar", "baz" ]; |
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
// lib/main.js | |
var pageMod = require("page-mod"); | |
var self = require("self"); | |
pageMod.PageMod({ | |
include: "*", | |
contentScriptWhen: 'ready', | |
contentScriptFile: [self.data.url("jquery-1.7.2.min.js"), | |
self.data.url("zebra.js")] |
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
def grid_search(features, results): | |
gamma_values = [(2 ** n) for n in range(-15, 4)] | |
cost_values = [(2 ** n) for n in range(-5, 16)] | |
params_values = [(gamma, cost) for gamma in gamma_values | |
for cost in cost_values] | |
best_auc = 0 | |
best_gamma = None | |
best_cost = None |
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
[bgeiger@Maximus][~/Desktop]$ which clang | |
/usr/bin/clang | |
[bgeiger@Maximus][~/Desktop]$ clang --version | |
Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn) | |
Target: x86_64-apple-darwin12.1.0 | |
Thread model: posix | |
[bgeiger@Maximus][~/Desktop]$ which gcc | |
/usr/bin/gcc | |
[bgeiger@Maximus][~/Desktop]$ gcc --version | |
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) |
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
# Remove non-alphabetic characters (hyphens, etc) from the word. | |
def strip_non_alpha(word): | |
return "".join([x for x in list(word.lower()) if (x >= 'a' and x <= 'z')]) | |
# Sort the letters in the word (in reverse). | |
def sort_letters(word): | |
letters = sorted(list(word)) | |
letters.reverse() | |
return "".join(letters) |
OlderNewer