This file contains hidden or 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
<?xml version="1.0" encoding="utf-8" ?> | |
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ --> | |
<!-- Active URL: http://socrates.devbootcamp.com/sql.html --> | |
<sql> | |
<datatypes db="mysql"> | |
<group label="Numeric" color="rgb(238,238,170)"> | |
<type label="Integer" length="0" sql="INTEGER" re="INT" quote=""/> | |
<type label="Decimal" length="1" sql="DECIMAL" re="DEC" quote=""/> | |
<type label="Single precision" length="0" sql="FLOAT" quote=""/> | |
<type label="Double precision" length="0" sql="DOUBLE" re="DOUBLE" quote=""/> |
This file contains hidden or 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 cheat sheet / EXAMPLES | |
INSTALL | |
======= | |
$ gem install activerecord | |
in GEMFILE: gem ‘activerecord’ | |
REQUIRE | |
======= | |
require ‘active_record’ |
This file contains hidden or 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 value | |
@values = 0 | |
Post.find(self.id).votes.each do |vote| | |
if vote.vote_value == nil | |
vote.vote_value = 0 | |
else | |
@values += vote.vote_value | |
end | |
end |
This file contains hidden or 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: start trajectory story | |
* run specific tests wrote (eg: rspec spec/decorators/event_decorator_spec.rb:5) | |
rake | |
git status | |
git diff |
This file contains hidden or 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
hjkl - move around | |
:#,#d - deletes between two lines, eg: :10,12d deletes lines 10 through 12 | |
x - delete character | |
o - insert on next line | |
O - insert on preceding line | |
a - insert after cursor | |
i - go into insert mode | |
w - move to beginning of next word (also W for whitespace delimited word) | |
e - move to end of word (also E for whitespace delimited words) | |
b - move backward to start of word (also B) |
This file contains hidden or 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 Paperclip | |
class Merge < Processor | |
def initialize file, options = {}, attachment = nil | |
super | |
@format = File.extname(@file.path) | |
@basename = File.basename(@file.path, @format) | |
@files = attachment.instance.files | |
end | |
def make |
This file contains hidden or 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 RecommendationHelper, '#user_name' do | |
it 'returns the name if the user has a name' do | |
user = create(:user) | |
user.stubs(:name).returns('Jane Doe') | |
ask = create(:ask, user: user) | |
user_name = user_name(ask) |
This file contains hidden or 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
$ heroku pgbackups:capture --expire --app APP_NAME | |
$ curl -o latest.dump `heroku pgbackups:url --app APP_NAME` | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -d DEVELOPMENT_DATABASE_NAME latest.dump |
This file contains hidden or 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 FieldEntry, '#to_hash' do | |
it 'returns the correct hash format' do | |
field_entry = FieldEntry.new("room",["a","b,"c"]).to_hash | |
expect(field_entry).to eq { name: 'room', values: [ "a", "b", "c"] } | |
end | |
end | |
This file contains hidden or 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
times in msec | |
clock self+sourced self: sourced script | |
clock elapsed: other lines | |
000.015 000.015: --- VIM STARTING --- | |
000.132 000.117: Allocated generic buffers | |
000.599 000.467: locale set | |
000.606 000.007: window checked | |
001.068 000.462: inits 1 | |
001.076 000.008: parsing arguments |