Skip to content

Instantly share code, notes, and snippets.

View miaoever's full-sized avatar

Miaojiang (MJ) Deng miaoever

  • Facebook
  • San Francisco
View GitHub Profile
$("#submit").click(function(){
var bad = false; //the date is good or bad?
var end_time = $("#timetext").val().split("-"); //date fomart: 2013-6-6
var begin_time = $("#begin_time").text().split("-");
var diff_year = end_time[0] - begin_time[0];
var diff_mon = end_time[1] - begin_time[1];
var diff_day = end_time[2] - begin_time[2];
if (diff_year < 0)
bad = true;
else if (diff_year == 0) {
@miaoever
miaoever / gist:3295579
Created August 8, 2012 14:47 — forked from fxsjy/gist:3291755
Memcached in JavaScript based on Node.JS
//author: Sun, Junyi (weibo.com/treapdb)
//usage: node --nouse-idle-notification --expose-gc --max-old-space-size=8192 memcached.js
var config ={
port: 11211,
max_memory: 100 // default 100M bytes
}
var net = require('net');
var LRU = function (max) { // this LRU implementaion is based on https://github.com/chriso/lru