(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
carousel = (sel) -> | |
[$car, ci, ia] = [ $(sel), ".carousel-item", "is-active" ] | |
[$inner, len] = [ $car.find("> div"), $car.find(ci).length ] | |
[cur, blobs] = [ 0, [] ] | |
$inner.css "width" : len * (width = parseInt($car.find(ci) \ | |
.first().addClass(ia).css("width"), 10)) | |
rotate = -> | |
move.apply blobs[if ++cur <= len - 1 then cur else cur = 0], [false] |
var delegate = (function(){ | |
var match = (function(){ | |
var guineaPig = document.createElement('div'); | |
if(guineaPig.matchesSelector) return function(elem, selector){ | |
return elem.matchesSelector(selector); | |
}; | |
if(guineaPig.mozMatchesSelector) return function(elem, selector){ | |
return elem.mozMatchesSelector(selector); | |
}; |
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.
Despite being derived from classical MVC pattern JavaScript and the environment it runs in makes Javascript MVC implementation have its own twists. Lets see how typical web MVC functions and then dive into simple, concrete JavaScript MVC implementation.
Typical server-side MVC implementation has one MVC stack layered behind the singe point of entry. This single point of entry means that all HTTP requests, e.g. http://www.example.com or http://www.example.com/whichever-page/ etc., are routed, by a server configuration, through one point or, to be bold, one file, e.g. index.php.
At that point, there would be an implementation of Front Controller pattern which analyzes HTTP request (URI at first place) and based on it decides which class (Controller) and its method (Action) are to be invoked as a response to the request (method is name for function and member is name for a variable when part of the class/object).
class Person (db.Document): | |
name = db.StringField(required=True) | |
created_date = db.ComplexDateTimeField(default=datetime.datetime.utcnow(), required=True) | |
def to_dict(self): | |
return helper.mongo_to_dict(self,[]) | |
#helper.py | |
def mongo_to_dict(obj, exclude_fields): |
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
#!/bin/sh | |
# | |
# Setup a work space called `work` with two windows | |
# first window has 3 panes. | |
# The first pane set at 65%, split horizontally, set to api root and running vim | |
# pane 2 is split at 25% and running redis-server | |
# pane 3 is set to api root and bash prompt. | |
# note: `api` aliased to `cd ~/path/to/work` | |
# | |
session="work" |