Skip to content

Instantly share code, notes, and snippets.

View rrouse's full-sized avatar

Robert Rouse rrouse

  • St. Louis, Missouri
View GitHub Profile
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :load_config
def load_config
@site = Siteconfig.first
end
@rrouse
rrouse / sort.fal
Last active December 25, 2015 18:19
Sort in falcon
s = InputStream(args[0])
o = OutputStream(args[1])
sorted = Set().comp( s.grabLine )
s.close()
for item in sorted: o.writeText(item + "\n")
o.close()
# falcon sort.fal lines.txt sorted.txt
task :stop, :roles => :app do
run "kill -QUIT `cat #{shared_path}/pids/unicorn.pid`"
end
desc "Restart app server"
task :restart, :roles => :app do
run "kill -USR2 `cat #{shared_path}/pids/unicorn.pid`"
end
task :start, :roles => :app do
#encoding: utf-8
def ╯°□°╯︵┻━┻ message
throw RuntimeError.new(message)
end
╯°□°╯︵┻━┻ "damnit"
@rrouse
rrouse / ActionbarTabsPager.java
Created November 26, 2012 13:57 — forked from graetzer/ActionbarTabsPager.java
Android FragmentTabsPager with Actionbarsherlock
import java.util.ArrayList;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.ViewPager;
@rrouse
rrouse / status_header_setter
Created July 4, 2012 19:35 — forked from ktkaushik/status_header_setter
Set HTTP status headers with respond_with( object ) in rails.
1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok
def blah
"blah".nil? && "bleh".nil?
puts "hi"
else
puts "hello"
end
Calling blah prints hi and hello, but doesn't error. It warns in irb with (irb):6: warning: else without rescue is useless
otool -L /Volumes/AXR\ Prototype/AXR\ Prototype.app/Contents/Resources/libcairo.2.dylib
/Volumes/AXR Prototype/AXR Prototype.app/Contents/Resources/libcairo.2.dylib:
@executable_path/../Resources/libcairo.2.dylib (compatibility version 11003.0.0, current version 11003.2.0)
@executable_path/../Resources/libpixman-1.0.dylib (compatibility version 21.0.0, current version 21.2.0)
/usr/X11/lib/libfontconfig.1.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/local/lib/libfreetype.6.dylib (compatibility version 13.0.0, current version 13.2.0)
/usr/local/lib/libpng15.15.dylib (compatibility version 18.0.0, current version 18.0.0)
/usr/X11/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/X11/lib/libX11.6.dylib (compatibility version 9.0.0, current version 9.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
The over-emphasis on launch hides the fact that software today can be modified and redistributed with relative ease.
We don’t “ship” software anymore. We download it off the Internet, or the software itself is entirely web-based.
When launch dates get pushed back because features absolutely need to be crammed in, developer morale suffers.
It’s a complete buzz kill for a development team.
Ka Wai Cheung. The Developer's Code, P1.0 (Kindle Locations 302-304). The Pragmatic Bookshelf (346536).
pushd ${OPENSHIFT_REPO_DIR} > /dev/null
bundle exec rake db:migrate RAILS_ENV="production"
popd > /dev/null