Skip to content

Instantly share code, notes, and snippets.

View usherwong's full-sized avatar
🎯
Focusing

usherwong usherwong

🎯
Focusing
  • Meituan-Dianping
  • beijing
View GitHub Profile
function lazyMan (name) {
let man = { name };
let tasks = [];
let excute = () => {
let task = tasks.shift();
task && task();
};
man.talk = () => {
tasks.push(() => {
console.log(`Hi! This is ${name}!`);
@dead-horse
dead-horse / dump.js
Created November 13, 2012 03:29
mongodb数据库定时备份
/*!
* dump.js, dump mongodb.
* Copyright(c) 2012 Taobao.com
* Author: busi.hyy <busi.hyy@taobao.com>
*
* 每天凌晨3点从mongo dump一份到指定文件夹,前缀为20121113_
* 只保留最近七天的dump文件
* Example: `node dump 127.0.0.1:27071 back database collection1 collection2 ...`
*/
@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@diorahman
diorahman / client.html
Created December 26, 2011 03:34
Ajax, call jQuery POST to node.js expressjs
<html>
<head>
<title>jsonp test</title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('#select_link').click(function(e){
e.preventDefault();
console.log('select_link clicked');