From: source
Init scripts hopefully need no explanation. Scripts reside in /etc/init.d with root ownership and executable permissions. e.g.:
sudo su
cp my-application-script /etc/init.d/my-application
From: source
Init scripts hopefully need no explanation. Scripts reside in /etc/init.d with root ownership and executable permissions. e.g.:
sudo su
cp my-application-script /etc/init.d/my-application
var nums = [35, 25, 53, 3, 102, 203, 230, 1005]; | |
// Figure out the number of binary digits we're dealing with | |
var k = Math.max.apply(null, nums.map(function(i) { | |
return Math.ceil(Math.log(i)/Math.log(2)); | |
})); | |
for (var d = 0; d < k; ++d) { | |
for (var i = 0, p = 0, b = 1 << d, n = nums.length; i < n; ++i) { | |
var o = nums[i]; |
tim@touchsmart:~/Code$ nvm use v0.11.2-generators | |
Now using node v0.11.2-generators | |
tim@touchsmart:~/Code$ node --harmony testgen.js | |
<Buffer 76 61 72 20 66 73 20 3d 20 72 65 71 75 69 72 65 28 27 66 73 27 29 3b 0a 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 46 69 6c 65 28 70 61 74 68 2c 20 65 6e 63 ...> | |
Sleeping for 2000ms... | |
Done |
/*global ActiveXObject*/ | |
/** | |
* Provides Cross Browser Plugin Detection for Quicktime, Flash, Windows Media, Acrobat, Java, etc... or whatever you extend it to. Modified version of http://www.knallgrau.at/code/plugin_js version 0.5 | |
* @author https://github.com/JamieMason | |
* @constructor | |
*/ | |
function PluginSniffer() | |
{ | |
var self = this; // Reference this instance, whatever it might be called instead of Plugin |
#!/bin/bash | |
# | |
# initd-example Node init.d | |
# | |
# chkconfig: 345 80 20 | |
# description: Node init.d example | |
# processname: node | |
# pidfile: /var/run/initd-example.pid | |
# logfile: /var/log/initd-example.log | |
# |
(aka "errback" or "error first callback")
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("") | |
base = alphabet.length | |
exports.encode = (i) -> | |
return alphabet[0] if i is 0 | |
s = "" | |
while i > 0 | |
s += alphabet[i % base] | |
i = parseInt(i / base, 10) |
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.