As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
MongoDB provides a Javascript shell. But Javascript is no fun without underscore.js | |
Turned out its straight forward to use underscore.js while scripting mongodb. | |
Here are the steps. | |
1) Use underscore to write your db script file (say my_commands.js) | |
E.g: _.each(db.dbname.find().toArray(), function(itm) { ... }) |
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}"
}
}
<head> | |
<title>meteor_servercall</title> | |
</head> | |
<body> | |
{{> simple}} | |
{{> passData}} | |
</body> | |
<template name="simple"> |
#!/bin/sh | |
# sips resample images | |
sips --resampleHeightWidth 100 80 image.png | |
sips --resampleWidth 80 image.png | |
sips --resampleHeight 80 image.png |
#!/bin/bash | |
# __ | |
# _____ ____ _/ |_ ____ ____ _______ | |
# / \ _/ __ \ \ __\_/ __ \ / _ \ \_ __ \ | |
# | Y Y \\ ___/ | | \ ___/ ( <_> ) | | \/ | |
# |__|_| / \___ > |__| \___ > \____/ |__| | |
# \/ \/ \/ | |
# | |
# .___ | |
# __| _/ __ __ _____ ______ |
if(Meteor.isClient){ | |
// set Session variable in method callback | |
Meteor.call('myMeteorMethod', "foo", function(error, result){ | |
Session.set('myMethodResult', result); | |
}); | |
// use reactive Session variable in helper | |
Template.myTemplate.helpers({ | |
myHelper: function(){ |
A simple example showing how to detect a double tap with d3.js, and an accompanying method for reusability.