$ rails g model User
belongs_to
has_one
| // It is important to declare your variables. | |
| (function() { | |
| var foo = 'Hello, world!'; | |
| print(foo); //=> Hello, world! | |
| })(); | |
| // Because if you don't, the become global variables. | |
| (function() { |
| =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') |
| ... | |
| module Helpers | |
| # Replace standard input with faked one StringIO. | |
| def fake_stdin(*args) | |
| begin | |
| $stdin = StringIO.new | |
| $stdin.puts(args.shift) until args.empty? | |
| $stdin.rewind | |
| yield |
| #!/usr/bin/env bash | |
| # bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2019-01-02 | |
| # | |
| # _______________| noise : ambient Brown noise generator (cf. white noise). | |
| # | |
| # Usage: noise [minutes=59] [band-pass freq center=1786] [wave] | |
| # ^minutes can be any positive integer. | |
| # Command "noise 1" will display peak-level meter. | |
| # | |
| # Dependencies: play (from sox package) |
| // FFmpeg settings for vimeo.com | |
| // ============================= | |
| // Trying to find the best settings for encoding videos as described here: http://vimeo.com/help/compression | |
| // | |
| // Input file: MTS | |
| // Video: H264, 1920x1080, 50fps | |
| // Audio: A52 Audio (aka AC3), Stereo, 48kHz, 256kbps | |
| ffmpeg -i input.mts -vcodec libx264 -acodec aac -strict experimental -vpre hq -s hd720 -b 5000k -ab 320k -r 25 -g 25 -threads 0 output.mp4 |
Place me.mailcatcher.plist into ~/Library/LaunchAgents, then run launchctl load ~/Library/LaunchAgents/me.mailcatcher.plist.
If you use pow, echo 1080 > ~/.pow/mailcatcher and go to http://mailcatcher.dev, otherwise use http://localhost:1080.
Currently pow doesn't seem to pass websockets through correctly. Looking into this.
As configured in my dotfiles.
start new:
tmux
start new with session name:
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| # config/initializers/redcarpet.rb | |
| module ActionView | |
| module Template::Handlers | |
| class Markdown | |
| class_attribute :default_format | |
| self.default_format = Mime::HTML | |
| def call(template) | |
| markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true) | |
| markdown.render(template.source).html_safe.inspect |