This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install | |
curl http://npmjs.org/install.sh | sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.moc/themes/monochrome_theme | |
# Add `Theme = monochrome_theme` to your ~/.moc/config | |
background = default default | |
frame = default default | |
window_title = default default | |
directory = default default | |
selected_directory = default default reverse | |
playlist = default default | |
selected_playlist = default default reverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var max = 10, | |
x = {vs:') versus '}; | |
for (var i=0; i<max; i++) { | |
console.log('i: ', i); | |
setTimeout((function(number) { console.log('i(' + i + this.vs + number); }).bind(x), (i * 500), i); | |
} |
One of CoffeeScript's best features is the @
shorthand for this
-- perfect for accessing instance methods and properties:
class Rectangle
constructor: (@width, @height) ->
getArea: ->
@width * @height
But there's no similar shorthand for accessing static members, e.g. @@
. So instead, you're forced to either hardcode class names, or type out the long constructor
reference to be generic:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## Node.js for Raspberry Pi Packaging Script | |
## ========================================= | |
## Execute this script from within node.js git repo | |
## Use like this: | |
## ~/node/$ VERSION=v0.10.0 ./buildnode.sh | |
if [ -z $VERSION ]; then | |
echo "set the VERSION first" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FastMutex.prototype.runInLock = function (callback, opt_context) { | |
this._setX() | |
if (!this._isLockAvailable()) { | |
this._retry(callback, opt_context) | |
return | |
} | |
this._setY() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
Mirrors: standalone servers with complete copy of npm registry
Proxies: proxy to the database (couchdb) of npm registry, if only the npm registry server fails but the db works
## HowTo See this gist: https://gist.github.com/3331671
(+) means server is self updating (pulls newest stuff from offical registry when back online again)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import paho.mqtt.client as mqtt | |
# Configuration | |
################ | |
## Server | |
mqtt_server = "turris" | |
mqtt_port = 1883 | |
# Core module minimal voltage |
OlderNewer