This file contains 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 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 |
This file contains 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
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 |
This file contains 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
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 |
This file contains 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
#encoding: utf-8 | |
def ╯°□°╯︵┻━┻ message | |
throw RuntimeError.new(message) | |
end | |
╯°□°╯︵┻━┻ "damnit" |
This file contains 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
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; |
This file contains 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
1xx Informational | |
100 Continue :continue | |
101 Switching Protocols :switching_protocols | |
102 Processing :processing | |
2xx Success | |
200 OK :ok |
This file contains 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
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 |
This file contains 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
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) |
This file contains 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
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). |
This file contains 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
pushd ${OPENSHIFT_REPO_DIR} > /dev/null | |
bundle exec rake db:migrate RAILS_ENV="production" | |
popd > /dev/null |
NewerOlder