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
//express3.0 | |
var express = require('express'); | |
var app = express(); | |
app.set('port', 3000); | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'jade'); | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); | |
//session & cookie |
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 derby = require('derby'); | |
var app = derby.createApp(module); | |
// import derby components | |
derby.use(require('derby-ui-boot')); | |
derby.use(require('../../ui')); | |
// ROUTES // |
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
/** | |
* format date. | |
* @param {Date/Number} obj date to format, support Date or timestamp | |
* @example | |
* formatDate(new Date(),"yyyy-MM-dd hh:mm:ss") | |
* formatDate(new Date().setHours(0,0,0,0),"yyyy-MM-dd hh:mm:ss") | |
*/ | |
function formatDate(obj,format){ | |
var date = obj; | |
if(toString.call(obj) !== '[object Date]'){ |
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
[root@etone46 node]# gdb --args out/Debug/node /usr/local/bin/npm list | |
GNU gdb Red Hat Linux (6.5-25.el5rh) | |
Copyright (C) 2006 Free Software Foundation, Inc. | |
GDB is free software, covered by the GNU General Public License, and you are | |
welcome to change it and/or distribute copies of it under certain conditions. | |
Type "show copying" to see the conditions. | |
There is absolutely no warranty for GDB. Type "show warranty" for details. | |
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1". | |
(gdb) run |
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
/** | |
* PING测试 | |
* @example | |
* var ping = require('./lib/ping'); | |
* ping('www.baidu.com',function(err,result){ | |
* console.log(result,err) | |
* }) | |
*/ | |
"use strict"; |
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
// ==UserScript== | |
// @name zhihu-favorites | |
// @namespace https://gist.github.com/4602119 | |
// @version 0.1 | |
// @description 加载并展开知乎收藏夹 | |
// @match http://www.zhihu.com/collection/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @copyright 2012+, TZ <[email protected]> | |
// ==/UserScript== |
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(a,b){"use strict";function i(a,b){return g.call(a,b)}function j(a){return"[object Function]"===f.call(a)}function n(a){var b={};return l(a,function(a){b[a]=1}),m(b)}function s(a,b,c){return r(a,b),b[c||m(b)[0]]}function y(a){var b=a.match(t);return(b?b[0]:".")+"/"}function z(a){if(a.lastIndexOf("//")>7&&(a=a.replace(u,"$1/")),-1===a.indexOf("."))return a;for(var d,b=a.split("/"),c=[],e=0;b.length>e;e++)if(d=b[e],".."===d){if(0===c.length)throw new Error("The path is invalid: "+a);c.pop()}else"."!==d&&c.push(d);return c.join("/")}function A(a){a=z(a);var b=a.charAt(a.length-1);return"#"===b?a=a.slice(0,-1):v.test(a)||-1!==a.indexOf("?")||(a+=".js"),a=a.replace(":80/","/")}function B(a){var b=Ab.alias;return b&&i(b,a)&&J(a)&&(a=b[a]),a}function C(a){var b=Ab.vars;return b&&a.indexOf("{")>-1&&(a=a.replace(x,function(a,c){return i(b,c)?b[c]:"{"+c+"}"})),a}function D(a,b){var c;return G(a)?c=a:H(a)?(0===a.indexOf("./")&&(a=a.substring(2)),c=y(b)+a):c=I(a)?b.match(w)[1]+a:Ab.base+a,c}function E(a){var b=A |
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
liuyong@GIT:/home/git/gitolite$ ruby -v | |
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux] | |
liuyong@GIT:/home/git/gitolite$ git status | |
# On branch gl-v320 | |
# Untracked files: | |
# (use "git add <file>..." to include in what will be committed) | |
# | |
# src/VERSION | |
nothing added to commit but untracked files present (use "git add" to track) |
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
module.exports = function (grunt) { | |
'use strict'; | |
grunt.loadNpmTasks('grunt-express'); | |
grunt.initConfig({ | |
express: { | |
options: { | |
port: 9000, | |
hostname: '*' | |
}, | |
server: { |
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
/** | |
* format date. | |
* | |
* formatDate(new Date(),"yyyy-MM-dd hh:mm:ss") | |
* formatDate(new Date().setHours(0,0,0,0),"yyyy-MM-dd hh:mm:ss") | |
* | |
* 更建议用类库: [moment.js](http://momentjs.com/) | |
* | |
* @param {Date/Number} [obj] date to format, support Date or timestamp | |
* @param {String} [format] 格式 |
OlderNewer