##Some apps to install before moving forward:
- F.lux
- https://justgetflux.com
- direct: https://justgetflux.com/dlmac.html
- temp fix on 10.10: disable automatic graphics switching (System Preferences -> Energy Saver)
- Spectacle
- iTerm 2
| =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') |
| class DatafeedsController < ApplicationController | |
| API_KEY = 'my encrypted key is here' | |
| # Parses Foxycart datafeed v060 | |
| # see http://wiki.foxycart.com/docs/datafeed for details | |
| def create | |
| require 'ruby-rc4' | |
| require 'nokogiri' |
| require "spec_helper" | |
| describe ExampleController do | |
| context "GET #index" do | |
| let(:resources) { FactoryGirl.create_list(:resource) } | |
| before do | |
| get :index | |
| end |
| :javascript | |
| var _gaq = _gaq || []; | |
| _gaq.push(['_setAccount', YOUR_CODE']); | |
| _gaq.push(['_trackPageview']); | |
| (function() { | |
| var ga = document.createElement('script'); | |
| ga.type = 'text/javascript'; ga.async = true; | |
| ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
| var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | |
| })(); |
| App.Views.MyView = Backbone.View.extend({ | |
| initialize: function() { | |
| _.bindAll(this); //Ignore this for now =) | |
| this.template = JST['path/to/template']; | |
| this.render(); | |
| }, | |
| render: function() { | |
| this.$el.html(this.template({ | |
| })); |
| require "spec_helper" | |
| describe ExampleController do | |
| context "GET #index" do | |
| let(:resources) { FactoryGirl.create_list(:resource) } | |
| before do | |
| get :index | |
| end |
| if [ -f "$rvm_path/scripts/rvm" ]; then | |
| source "$rvm_path/scripts/rvm" | |
| if [ -f ".rvmrc" ]; then | |
| source ".rvmrc" | |
| fi | |
| if [ -f ".ruby-version" ]; then | |
| rvm use `cat .ruby-version` | |
| fi |
| // This is a slightly modified version of two patches. The first suggested at | |
| // http://stackoverflow.com/questions/5802461/javascript-which-browsers-support-parsing-of-iso-8601-date-string-with-date-par | |
| // and the second, for Date.js suggested at | |
| // http://stackoverflow.com/questions/12145437/date-js-parsing-an-iso-8601-utc-date-incorrectly | |
| // | |
| // Here we override the implementation of Date.parse provided by Date.js. In this implementation we | |
| // first check to see if we can construct the date using the Date constructor. If we can, we move | |
| // along. If we cannot, we attempt to start the Date.js grammar parser. If that, too, fails us, we | |
| // then assume we're running in IE 8, and someone passed in an ISO8601 string, which IE8's date | |
| // constructor won't recognize. So we try to manually parse it out, returning a Date instance. |
##Some apps to install before moving forward:
Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.