- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
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
function setCursor(input) { | |
input.focus() | |
if (window.netscape) { | |
setTimeout(function() { //方法一 W3C,不过除firefox的浏览器可以直接用input.value = input.value搞定 | |
var n = input.value.length | |
input.setSelectionRange(n, n); | |
input.focus() | |
}, 0) | |
var n = input.value.length //方法二 | |
input.selectionStart = n |
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
"use strict"; | |
// MIT License | |
// author: Tetsuharu OHZEKI | |
/* | |
* Parse from HTML text to DOM subtree which does not have scripting items. | |
* | |
* @param {string} aText | |
* @return {DocumentFragment} |
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/bash | |
# USEAGE: | |
# slowy "remove latest limiter | |
# slowy 20 "set limiter as 20KByte/s for 80 port | |
# another choice (http://slowyapp.com/) | |
if [ {query} ]; then | |
sudo ipfw pipe 1 config bw {query}KByte/s && sudo ipfw add 1 pipe 1 src-port 80 | |
echo 'bandwidth.max is {query}KByte/s for 80 port' | |
else |
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 | |
### BEGIN INIT INFO | |
# Provides: supervisord | |
# Required-Start: $remote_fs | |
# Required-Stop: $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Example initscript | |
# Description: This file should be used to construct scripts to be | |
# placed in /etc/init.d. |