Skip to content

Instantly share code, notes, and snippets.

View owengalenjones's full-sized avatar

Owen Galen Jones owengalenjones

View GitHub Profile
class Solution {
public int rob(int[] nums) {
if(nums.length == 0) { return 0; }
int takeA = nums[0], leaveA = 0, takeB = 0, leaveB = 0;
for(int i = 1; i < nums.length; i++) {
int tmpTakeA = takeA, tmpLeaveA = leaveA, tmpTakeB = takeB, tmpLeaveB = leaveB;
takeA = (i == nums.length - 1) ? 0 : tmpLeaveA + nums[i];
@owengalenjones
owengalenjones / config.ru
Created March 5, 2012 17:42
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
# The following lines should come as no surprise. Except by
@owengalenjones
owengalenjones / Solarized Dark.itermcolors
Created September 14, 2011 01:04 — forked from heisters/Solarized High Contrast Dark.itermcolors
Solarized High Contrast Dark theme for iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>