Go to Sublime Text 2 > Preferences > Key Bindings - User
and add this JSON to the file:
[
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}
}
// A means of using underscore.js to do templates with conditionals | |
// Inside of underscore's template, it returns a function that uses | |
// 'with' on a variable named obj, and you can touch into that using | |
// inline JS and <% %> wrappers | |
// A template with conditional display of last names: | |
var good = _.template("Hello: <%= name %> <% if (obj.lastname) { %> <%= lastname %> <% } %>"); | |
// A template that tries to do that, but fails: | |
var bad = _.template("Hello: <%= name %> <% if (lastname) { %> <%= lastname %> <% } %>"); |
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
Go to Sublime Text 2 > Preferences > Key Bindings - User
and add this JSON to the file:
[
{ "keys": ["super+shift+l"],
"command": "insert_snippet",
"args": {
"contents": "console.log(${1:}$SELECTION);${0}"
}
}
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: thin | |
# Required-Start: $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: S 0 1 6 | |
# Short-Description: thin initscript | |
# Description: thin | |
### END INIT INFO |
# put this in your .bash_profile | |
if [ $ITERM_SESSION_ID ]; then | |
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND"; | |
fi | |
# Piece-by-Piece Explanation: | |
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment | |
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too | |
# the $PROMPT_COMMAND environment variable is executed every time a command is run | |
# see: ss64.com/bash/syntax-prompt.html |
const express = require('express') | |
const cors = require('cors') | |
const bodyParser = require('body-parser') | |
const app = express() | |
app.use(bodyParser.urlencoded({ extended: true })) | |
app.use(cors()) | |
app.post('/dev_log', function (req, res, next) { |
While the public API intended for users to use is the scheduler
package, the reconciler currently
does not use scheduler
's priority classes internally.
ReactFiberScheduler
has its own internal "mini-scheduler" that uses the scheduler
package
indirectly for its deadline-capable scheduleCallback.
This is kind of a documentation of implementation details that I suppose will be gone by the end of the year, but what can you do.
Prefix | Description | Notes | |
---|---|---|---|
ac_ | Platform Client ID | Identifier for an auth code/client id. | |
acct_ | Account ID | Identifier for an Account object. | |
aliacc_ | Alipay Account ID | Identifier for an Alipay account. | |
ba_ | Bank Account ID | Identifier for a Bank Account object. | |
btok_ | Bank Token ID | Identifier for a Bank Token object. | |
card_ | Card ID | Identifier for a Card object. | |
cbtxn_ | Customer Balance Transaction ID | Identifier for a Customer Balance Transaction object. | |
ch_ | Charge ID | Identifier for a Charge object. | |
cn_ | Credit Note ID | Identifier for a Credit Note object. |