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
| source 'https://rubygems.org' | |
| gem 'rails', '3.2.11' | |
| # Bundle edge Rails instead: | |
| # gem 'rails', :git => 'git://github.com/rails/rails.git' | |
| gem 'sqlite3' | |
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
| vertis | |
| phlipper | |
| reinh | |
| dwradcliffe | |
| jtimberman | |
| coderanger | |
| btm | |
| skottler | |
| mitchellh | |
| englishm |
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
| @media only screen and (-webkit-device-pixel-ratio: .75) { | |
| /* CSS for Low-density Android screens goes here * | |
| * Ex: HTC Evo, HTC Incredible, Nexus One */ | |
| } | |
| @media only screen and (-webkit-device-pixel-ratio: 1) and (max-device-width: 768px) { | |
| /* CSS for Medium-density Android screens goes here * | |
| * Ex: Samsung Ace, Kindle Fire, Macbook Pro * | |
| * max-device-width added so you don't target laptops and desktops */ | |
| } |
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
| { | |
| 'email_address': '[email protected]', | |
| 'name': 'Dwight\'s Flowers', | |
| 'merchant': { | |
| 'type': 'business', | |
| 'name': 'Dwight\'s Flowers LLC', | |
| 'tax_id': '123-123-123', | |
| 'phone_number': '(800) 555-1234', | |
| 'street_address': '1 My Businesses Registered Address', | |
| 'postal_code': '94301', |
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
| module Admin::InvoicesHelper | |
| def status_tag(status, level) | |
| content_tag(:span, status.titleize, :class => "status #{status} #{level}") | |
| end | |
| 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
| config.thread_safe | |
| Understanding fibers vs threads - Which one when and where? | |
| Observers. Evil or Useful? | |
| Securing Rails Applications - Common security mistakes and how to avoid them | |
| Demystify Memcached | |
| Fixtures and Test::Unit | |
| Performance Testing Rails Applications For Real | |
| Pry | |
| Relations in MongoDB - items document. lists holds references to all items for a list. Like to see this both with mongoid and CLI | |
| Elixr - What is it? What would I use it for? |
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
| $ brew --config | |
| HOMEBREW_VERSION: 0.9 | |
| HEAD: 83c77237ee4f99cae6313152b93eb686b2852645 | |
| HOMEBREW_PREFIX: /usr/local | |
| HOMEBREW_CELLAR: /usr/local/Cellar | |
| CPU: 8-core 64-bit penryn | |
| OS X: 10.8-x86_64 | |
| Xcode: 4.5 => /Applications/Xcode45-DP2.app/Contents/Developer | |
| CLT: 4.5.0.0.1.1249367152 | |
| GCC-4.0: N/A |
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
| echo -e "\n$(top -l 1 | awk '/PhysMem/';)\n" | |
| => PhysMem: 1701M wired, 6232M active, 976M inactive, 8909M used, 3376M free. | |
| Add to ~/.bash_profile | |
| alias freemem="top -l 1 | awk '/PhysMem/'" | |
| A more brief output: |
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 "test/unit" | |
| class TestMaximum < Test::Unit::TestCase | |
| def maximum(arr) | |
| arr.length == 1 ? arr.first : arr.sort.last | |
| end | |
| def test_maximum | |
| assert_equal maximum([2, 42, 22, 02]), 42 | |
| assert_equal maximum([-2, 0, 33, 304, 2, -2]), 304 |
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
| $ time ruby -e "100000000.times { [-2, 0, 33, 304, 2, -2].max }" | |
| real 1m43.896s | |
| user 1m43.859s | |
| sys 0m0.031s | |
| $ time ruby -e "100000000.times { [-2, 0, 33, 304, 2, -2].sort.last }" | |
| real 1m33.644s | |
| user 1m33.612s |