- Environment — clean Mac OS X 10.7.3 – Lion installation
- all other files are examples of each of following installation steps
- commented lines in examples is output of preceding command
- I'll use rvm for installing Ruby in this gist
This file contains hidden or 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
| require 'net/https' | |
| https = Net::HTTP.new('encrypted.google.com', 443) | |
| https.use_ssl = true | |
| https.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
| https.request_get('/') |
This file contains hidden or 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
| yard --plugin tomdoc -n . |
This file contains hidden or 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
| jekyll_site_var = nil | |
| def jekyll_site | |
| if jekyll_site_var.nil? | |
| jekyll_site_var = Jekyll::Site.new | |
| end | |
| jekyll_site_var | |
| end |
This file contains hidden or 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
| <?php | |
| $a = new PDO('pgsql:host=localhost;dbname=travis_development', 'mailo', 'password'); | |
| $sth = $a->prepare("SELECT * FROM artifacts"); | |
| $sth->execute(); | |
| $data = $sth->fetchAll(PDO::FETCH_ASSOC); | |
| var_dump($data); | |
| var_dump($a->errorInfo()); |
This file contains hidden or 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
| curl -v https://www.googleapis.com/urlshortener/v1/url -X POST -H 'Content-Type: application/json' -d "{\"longUrl\": \"$1\"}" |
This file contains hidden or 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
| ╰─$ defaults read com.apple.Safari NSQuitAlwaysKeepsWindows | |
| 2012-06-19 10:46:19.180 defaults[3319:707] | |
| The domain/default pair of (/Users/mailo/Library/Preferences/com.apple.Safari.plist, NSQuitAlwaysKeepsWindows) does not exist |
This file contains hidden or 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
| Loading development environment (Rails 3.2.6) | |
| 1.9.2p320 :001 > Game.accessible_attributes | |
| => #<ActiveModel::MassAssignmentSecurity::WhiteList: {"", "name"}> | |
| 1.9.2p320 :002 > Game.accessible_attributes.to_a | |
| => ["", "name"] | |
| 1.9.2p320 :003 > Game.accessible_attributes.to_a.reject{|i| i.empty?} | |
| => ["name"] |
This file contains hidden or 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
| Capybara.register_driver :selenium_chrome do |app| | |
| Capybara::Selenium::Driver.new app, :browser => :chrome | |
| end | |
| Capybara.javascript_driver = :selenium_chrome |
This file contains hidden or 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
| <?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>Label</key> | |
| <string>com.example.touchsomefile</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>touch</string> | |
| <string>/tmp/helloworld</string> |