start new:
tmux
start new with session name:
tmux new -s myname
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| =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') |
| ActiveRecord cheat sheet / EXAMPLES | |
| INSTALL | |
| ======= | |
| $ gem install activerecord | |
| in GEMFILE: gem ‘activerecord’ | |
| REQUIRE | |
| ======= | |
| require ‘active_record’ |
http://guides.rubyonrails.org/association_basics.html
http://guides.rubyonrails.org/migrations.html
| // Maintain ratio mixin. Great for responsive grids, or videos. | |
| // https://gist.github.com/brianmcallister/2932463 | |
| // | |
| // $ratio - Ratio the element needs to maintain. | |
| // | |
| // Examples | |
| // | |
| // // A 16:9 ratio would look like this: | |
| // .element { | |
| // @include maintain-ratio(16 9); |
TL;DR: This page (html, css, javascript, markdown) is being served from this gist using this server.
After working with AngularJS, which is totally awesome, I wanted a better way to share code snippets with the community. Something where the header declarations aren't hidden, so it's clear which version of angular you're using and whether zepto/jquery/underscore are loaded. I also wanted to use CoffeeScript, HAML and SCSS because that's what I use to write Goodfilms (my day job).
This HTML is being rendered from HAML, the CSS is being compiled from SCSS, the JS code is written in Coffeescript and even this here text is being compiled (in the browser) from a gist-hosted Markdown file.
| <% [:notice, :error, :alert].each do |level| %> | |
| <% unless flash[level].blank? %> | |
| <div class="alert-message <%= flash_class(level) %>"> | |
| <a class="close" href="#">×</a> | |
| <%= content_tag :p, flash[level] %> | |
| </div> | |
| <% end %> | |
| <% end %> |
| # 1) Use VCR.use_cassette in your let block. This will use | |
| # the cassette just for requests made by creating bar, not | |
| # for anything else in your test. | |
| let(:foo) { VCR.use_cassette("foo") { create(:bar) } } | |
| it "uses foo" do | |
| foo | |
| end | |
| # 2) Wrap the it block that uses #foo in VCR.use_cassette. |