- Buy a mac mini
- Install 10.8
- Create a user account for Jenkins
- Install xcode
- Turn on screen sharing
- Turn off energy save sleeping
- Login as your jenkins user
- Use ssh-keygen to create a key for github
- Create a github account for your build machine
- Add the key to your build machine github account
// This is the render method in the `ItemView` in my Backbone.Marionette plugin. | |
// It's a giant method - far too much happening in this one method, and poor | |
// use of memory with all of the methods that get re-defined on every use. | |
// | |
// It desperately needs to be cleaned up. But I can't do something quite as | |
// simple as just move the inner functions on to the ItemView itself. There | |
// are too many methods on the ItemView already. | |
// | |
// Suggestions? What are some good patterns to clean this up? | |
// |
function Ball() { | |
var self = this; | |
var full = false; | |
self.inflate = function() { | |
full = true; | |
}; | |
self.isFull = function() { |
# DATA FRAME OPERATIONS IN R | |
# Create data frame | |
# A dataset is ~ table (list of vectors) | |
id <- c(1,2,3) | |
name <- c("John", "Kirk", "AJ") | |
age <- c(21,27,18) | |
employees <- data.frame(ID=id, Name=name, Age=age) | |
employees |
// phantomjs --web-security=no most_used_css_property_names.js | |
var urls = [ | |
'http://google.com', | |
'http://facebook.com', | |
'http://youtube.com', | |
'http://yahoo.com', | |
'https://github.com/', | |
'http://twitter.com/', | |
'http://en.wikipedia.org/wiki/Main_Page', |
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
-
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the
secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection. -
Use production SSL certificates locally. This is annoying
group :production do | |
gem 'unicorn' | |
# Enable gzip compression on heroku, but don't compress images. | |
gem 'heroku-deflater' | |
# Heroku injects it if it's not in there already | |
gem 'rails_12factor' | |
end |