- Angers someone = 0.50 (negative or positiving depending on whether or not that person is liked)
- Long term Physical Health = 0.98
- Long term Mental Health = 0.95
- Short term Mental Health = 0.99
- Short term Physical Health = 0.85
- Endangers Self = -0.80
- Causes Someone to develop emotional attachment = -0.95
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
# This will never end because i++ wont be reached more than three times. | |
i = 0 | |
i = 0 | |
while i <= 10 | |
continue if i is 3 | |
console.log "The number is " + i | |
console.log "\n" | |
i++ |
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
class Numeric | |
def ones_complement(bits) | |
self ^ ((1 << bits) - 1) | |
end | |
end | |
def addbinary(b1, b2) | |
result = '' | |
carry = 0 | |
- Disable caps lock key (Sys Pref => Keyboard => Modifier Keys)
- System Pref -> Security -> Sleep Password
- Install Prey
- Install Alfred
- Install iTerm
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
/* | |
* JavaScript Pretty Date | |
* Copyright (c) 2008 John Resig (jquery.com) | |
* Licensed under the MIT license. | |
*/ | |
// Takes an ISO time and returns a string representing how | |
// long ago the date represents. | |
function prettyDate(time) { | |
var date = time, |
This all started when I moved to a design-in-browser workflow over the winter.
Designing in the browser is a workflow pain, jumping back into photoshop & shiny up a design is a productivity killer. I try to work in code as long as possible and avoid PS. I originally started out with an HTML/CSS to PSD converter using the PS API, although I got pretty far I quickly discovered it was going to be too slow. Parse HTML and for everything element create relevant layers, PS could barely handle it much less perform effectively.
I had two options; 1. Reverse engineer a PSD format writer or 2. Start work on a app that could speak both graphics and HTML. The latter seemed like an easier task so here I am.
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
should "be able to filter based on a symbol or path in a controller" do | |
mock_app do | |
controllers :foo do | |
before(:index, '/foo/main') { @test = 'before'} | |
get :index do | |
@test | |
end | |
get :main do | |
@test | |
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
TestingRoutes.controllers :main do | |
before(:index) { @test = 'before'} | |
get :index, :map => '/test' do | |
@test | |
end | |
end |