Skip to content

Instantly share code, notes, and snippets.

View torsday's full-sized avatar

Chris Torstenson torsday

View GitHub Profile
@torsday
torsday / assert.js
Created August 20, 2013 18:44
#testing #js
function assert(condition, message) {
if (!condition) {
throw message || "Assertion failed";
}
}
@torsday
torsday / last.js
Last active December 21, 2015 09:29
Implemented 'last' functionality to an array in js #js #snippets
// returns a single element of an array based upon it's offset from the end
if (!Array.prototype.last){
Array.prototype.last = function(offset){
return this[this.length - offset];
};
};
@torsday
torsday / .travis.yml
Created August 15, 2013 05:13
Travis #ruby #testing #dotfiles #travis
language: ruby
rvm:
- 1.9.3
env:
- DB=postgresql
script:
- bundle exec rake db:migrate
- bundle exec rake db:test:prepare
- bundle exec rake spec
before_script:
@torsday
torsday / gitignore.md
Last active December 19, 2015 03:49
Setting up Git Ignore globally

Setting up Git Ignore globally

Always ignore .DS_Store and vim swap files

Create

~/.gitignore

.DS\_Store
@torsday
torsday / book_list.md
Last active December 18, 2015 12:59
Reading Lists #lists
@torsday
torsday / favorite_apps_iOS.md
Last active December 17, 2015 12:19
Favorite Apps

Testing with RSpec

Definitions

General Testing

  • TDD Test Driven Development. Write examples before implementation.
  • BDD Behaviour-Driven Development is about implementing an application by describing its behavior from the perspective of its stakeholders. (The Rspec Book)
  • RSpec (mention alternatives, write a simple hand sewn test)
@torsday
torsday / plan.md
Last active December 17, 2015 00:49
Dev Bootcamp 30-Prep

30 Days leading up to Dev Bootcamp


Approach

  • Figure out your lifestyle for the period.
    • Sleep: Figure out a plan to give you 6.5 to 7.5 hours of sleep.
    • Social Life: You will have one, but it will be limited to a few hours on the weekend. Friends/family should know that this commitment does remove you from normal life.

Primary Prep

  1. edX: Harvard's CS50
@torsday
torsday / model_1.5.md
Last active December 16, 2015 23:39
survey fox models

IMGUR

<?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 -->
<sql>
<datatypes db="mysql">
@torsday
torsday / jquery_notes.md
Last active December 16, 2015 22:19
jQuery Notes

jQuery Notes


Event Basics

  • .preventDefault()
  • The on method is useful for binding the same handler function to multiple events
    • $.fn.click, $.fn.focus, $.fn.blur, $.fn.change
    • shorthand for jQuery's $.fn.on method