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
cd src/tools/bootstrap/ && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile | |
cd src/3rdparty/webkit/Source/ && /private/tmp/qt-4sJT/qt-everywhere-opensource-src-4.8.6/bin/qmake /private/tmp/qt-4sJT/qt-everywhere-opensource-src-4.8.6/src/3rdparty/webkit/Source/WebKit.pro -spec ../../../../mkspecs/unsupported/macx-clang-libc++ -o Makefile.WebKit | |
clang -c -pipe -O2 -arch x86_64 -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/unsupported/macx-clang-libc++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml ../../corelib/tools/qlocale_mac.mm -o .obj/release-shared/qlocale_mac.o | |
clang++ -c -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -O2 -fPIC -arch x86_64 |
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 Anagram | |
def initialize(target) | |
@target = target.downcase | |
end | |
def match(word_list) | |
word_list.select do |word| | |
is_anagram?(word.downcase) | |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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 problem_4(i);(((i.count('G')+i.count('C')).to_f/i.size)*100).round 4;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
(0..s.size).map{|i|r=s.index(t,i);r+1 if r}.uniq.join' ' |
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 problem_2(a,b);(0..a.size).select{|i|a[i]!=b[i]}.size;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
def problem1(i) | |
%w(A C G T).map{|l|i.split('').select{|b|b==l}.size}.join ' ' | |
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
module Rack | |
class JoinHtmlOutput | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
# get the original repsonse | |
status, headers, response = @app.call(env) |
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
My Personal Setup Instructions from fresh OSX1.8 (Mountain Lion) install: | |
Some notes on why I have chosen some of these preferences: | |
I am primarlily a Ruby web developer, and work on a variety of Ruby and Rails versions and database platforms. | |
I usually use RVM (http://rvm.beginrescueend.com), but this guide uses [chruby](https://github.com/postmodern/chruby) | |
I spend most of my day in the Terminal, Atom editor, and a Web Browser, and desire to keep things as simple and stock as possible, but do have certain minor preferences that make my day-to-day interaction with the computer better. | |
Choose Full-Disk encryption on Install and set a password | |
Run software update until it cannot find any updates |
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
# This script is intended to check if a Rails app is potentially vulnerable | |
# to CVE-2013-0156. There is no publicly known exploit for Rails on Ruby 1.8, | |
# but it is entirely possible due to the serializing of yaml objects | |
# | |
# By running this against an unpatched application, the log should indicate | |
# a timestamp being sent as params[:exploit] like so: | |
# Parameters: {"exploit"=>Thu Jan 01 00:00:00 +0000 1970, "action"=>"new", "controller"=>"sessions"} | |
# against a patched server, the exploit key will be missing entirely | |
# | |
# Besides upgrading to one of the patched versions of Rails, the following |