⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
=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') |
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
*/ | |
var http = require('http'), | |
fs = require('fs'), | |
util = require('util'); | |
http.createServer(function (req, res) { | |
var path = 'video.mp4'; |
//------------------------------------------------------------- | |
// | |
// Hypothesis: | |
// | |
// Promises/A is a Monad | |
// | |
// To be a Monad, it must provide at least: | |
// - A unit (aka return or mreturn) operation that creates a corresponding | |
// monadic value from a non-monadic value. | |
// - A bind operation that applies a function to a monadic value |
"Sets nice colorscheme | |
colorscheme slate | |
"Starts the syntax | |
syntax on | |
"Sets smart indent | |
set smartindent | |
"Sets 4 spaces on tab | |
set tabstop=4 | |
set shiftwidth=4 | |
set expandtab |
pygmentize -f rtf FILE | pbcopy
- Paste into TextEdit (in rich text mode: Format → Make Rich Text before pasting), and copy to clipboard again.
- In PowerPoint, Edit → Paste Special… → Styled Text.
(Pasting RTF directly into PowerPoint doesn't work correctly, at least with PowerPoint 2008 — it extends colour spans longer than it should, and sometimes removes line breaks. Going via TextEdit seems to solve the problem.)
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
operator (<~) 49 | |
{ $channel } => #{ yield csp.take($channel) } | |
operator (~>) 50 right | |
{ $value, $channel } => #{ yield csp.put($channel, $value) } | |
macro (<~alts) { | |
rule { } => { | |
yield csp.alts | |
} |
In React's terminology, there are five core types that are important to distinguish:
React Elements
#!/usr/bin/env ruby | |
# (1) Prevent any commit to production branches | |
PRODUCTION_BRANCHES = ["production"] | |
branch = `git rev-parse --abbrev-ref=strict HEAD`.chomp | |
if (PRODUCTION_BRANCHES.include?(branch)) | |
puts "\nDo you really want to commit on '#{branch}' branch?\nIf yes, add --no-verify to the commit command to force it." |