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
void doOperation(String opType, Data data); | |
// where opType is "insert", "append", or "delete", this should have clearly been an enum | |
String fetchWebsite(String url); | |
// where url is "https://google.com", this should have been an URN | |
String parseId(Input input); | |
// the return type is String but ids are actually Longs like "6345789" |
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
List<String> getSearchResults(...) { | |
try { | |
List<String> results = // make REST call to search service | |
return results; | |
} catch (RemoteInvocationException e) { | |
return Collections.emptyList(); | |
} | |
} |
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
# INSTALLATION | |
# Step 1: Install pyenv | |
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash | |
# This will output some instructions to add a few lines to | |
# your ~/.bash_profile file. Once you've done that | |
# then open a new terminal window to continue. | |
# Step 2: Install some versions of Python | |
# This will take a few minutes |
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' | |
describe 'foo' do | |
let(:concert) { FactoryGirl.create :concert } # Creates a concert with name 'default' | |
before do | |
Foo.bar(concert.id) | |
end | |
describe '.bar' 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
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
brew update | |
brew install git | |
git config --global user.name "{Your full name, ie. Steven Heidel}" | |
git config --global user.email "{Email you used to sign up for Github}" | |
git config --global credential.helper osxkeychain |
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
/home/steven/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -S bundle exec rspec /home/steven/.rvm/gems/ruby-1.9.2-p136/gems/refinerycms-settings-0.9.9.1/spec/models/refinery_setting_spec.rb /home/steven/.rvm/gems/ruby-1.9.2-p136/gems/refinerycms-core-0.9.9.1/spec/lib/refinery/plugins_spec.rb /home/steven/.rvm/gems/ruby-1.9.2-p136/gems/refinerycms-authentication-0.9.9.1/spec/models/user_spec.rb /home/steven/.rvm/gems/ruby-1.9.2-p136/gems/refinerycms-images-0.9.9.1/spec/models/image_spec.rb /home/steven/.rvm/gems/ruby-1.9.2-p136/gems/refinerycms-pages-0.9.9.1/spec/models/page_spec.rb /home/steven/.rvm/gems/ruby-1.9.2-p136/gems/refinerycms-resources-0.9.9.1/spec/models/resource_spec.rb | |
...........................FF................................................. | |
Failures: | |
1) User validations requires username | |
Failure/Error: User.new(@attr.merge(:username => "")).should_not be_valid | |
Psych::SyntaxError: | |
couldn't parse YAML at line 23 column 15 | |
# /home/steven/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1 |
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
Amanda I'm slightly confused by Refinery having both base and core | |
Philip THAT IS STEVEN | |
:P | |
http://github.com/resolve/refinerycms/wiki… | |
I use caps when I don't mean to yell | |
Amanda also, I can never find the code that happens when you generate a new app, but that's probably because I'm forgetful | |
Steven Heidel: I see you are the source of my pain | |
Philip bin/refinerycms | |
core/lib/generators/ | |
Steven Heidel: I bet you hear that from all the girls |
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
objects = [A, B, C, D, E, F, G, H, I...] # your objects | |
table = [] | |
(objects.length - 1).times do |i| | |
table << objects[i, 2] | |
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
steven@steven-laptop ~/code/redcar $ jruby -S rake | |
(in /home/steven/code/redcar) | |
/home/steven/code/redcar/Rakefile:145 warning: already initialized constant Spec | |
jruby -S spec -c plugins/edit_view/spec/edit_view/document_spec.rb plugins/todo_list/spec/todo_list/file_parser_spec.rb plugins/declarations/spec/declarations/file_spec.rb plugins/runnables/spec/runnables/output_processor_spec.rb plugins/application/spec/application/treebook_spec.rb plugins/application/spec/application/application_spec.rb plugins/application/spec/application/menu_spec.rb plugins/application/spec/application/command_spec.rb plugins/application/spec/application/notebook_spec.rb plugins/application/spec/application/clipboard_spec.rb plugins/application/spec/application/speedbar_spec.rb plugins/application/spec/application/sensitive_spec.rb plugins/application/spec/application/window_spec.rb plugins/edit_view_swt/spec/edit_view_swt/word_movement_spec.rb plugins/repl/spec/repl/groovy_mirror_spec.rb plugins/repl/spec/repl/ruby_mirror_spec. |
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 show | |
render :json => {:taken => username_taken(params[:username])} | |
end | |
def username_taken(username) | |
user = User.where("username = ?", username).first | |
if user.present? | |
return true |