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
infile = open(inputfilename, "r") | |
outfile = open(outputfilename, "w") | |
filter1 = subprocess.Popen(commandline1, stdin=infile, stdout=subprocess.PIPE, stderr=None) | |
filter2 = subprocess.Popen(commandline2, stdin=filter1.stdout, stdout=outfile, stderr=None) | |
filter1.stdout.close() # required so filter2 can get SIGPIPE, apparently | |
filter1.wait() | |
filter2.wait() |
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 max(seq, key=lambda x: x): | |
return reduce(lambda x, y: y if key(y) > key(x) else x, seq[1:], seq[0]) |
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/python | |
# | |
# Copyright (c) 2015 Benjamin Geiger <begeiger@mail.usf.edu> | |
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
from collections import defaultdict |
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/python | |
# | |
# Copyright (c) 2015 Benjamin Geiger <email.redacted> | |
""" | |
Module-specific doc string. | |
""" | |
from __future__ import absolute_import | |
from __future__ import division |
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" ]; |
OlderNewer