Skip to content

Instantly share code, notes, and snippets.

View atian25's full-sized avatar
🐷
is watching you.

TZ | 天猪 atian25

🐷
is watching you.
View GitHub Profile
@atian25
atian25 / Gruntfile.js
Last active August 29, 2015 13:56
grunt-express issue
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-express');
grunt.initConfig({
express: {
options: {
port: 9000,
hostname: '*'
},
server: {
/**
* 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] 格式
@atian25
atian25 / gist:ef1215d438bfaaf6139e
Created November 7, 2014 07:13
fis deploy plugin
load plugin!!! [larva-command-release] error : Cannot find module 'larva-command-release'
load plugin!!! [scrat-command-release] error : Cannot find module 'scrat-command-release'
[DEBUG] 15:12:09.0668 revert cache
[DEBUG] 15:12:09.0669 cache file exists
[DEBUG] 15:12:09.0669 cache info read
[DEBUG] 15:12:09.0669 cache is valid
@atian25
atian25 / terminal.sh
Last active August 29, 2015 14:17 — forked from Rpsl/terminal.sh
cd ~/Library/Application\ Support/WebStorm9/NativeNeighbourhood/classes/org/intellij/plugins/nativeNeighbourhood/icons/macosx
echo '#!/bin/sh
#
# Reveal a directory in the Terminal.
#
# The script takes one argument, the qualified name of a directory.
#
# Note that the script is necessary because osascript before osx 10.4 could not
# pass arguments.
@atian25
atian25 / gist:1e87b741b703b2a38fbf
Last active August 29, 2015 14:20
npm install scrat fail at iojs 2.0
➜ test git:(master) ✗ iojs -v
v2.0.1
➜ test git:(master) ✗ node -v
v2.0.1
➜ test git:(master) ✗ npm -v
2.9.0
➜ test git:(master) ✗ npm install scrat
> fis-sass@3.1.3 install /Users/tz/tmp/test/node_modules/scrat/node_modules/fis-parser-sass/node_modules/fis-sass
> node build.js
@atian25
atian25 / app-index.js
Created August 13, 2012 08:48
derby model question
var derby = require('derby');
var app = derby.createApp(module);
// import derby components
derby.use(require('derby-ui-boot'));
derby.use(require('../../ui'));
// ROUTES //
@atian25
atian25 / formatDate.js
Created August 15, 2012 09:13
formatDate
/**
* 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]'){
[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
@atian25
atian25 / ping.js
Created August 21, 2012 08:45
PING操作-简单封装
/**
* PING测试
* @example
* var ping = require('./lib/ping');
* ping('www.baidu.com',function(err,result){
* console.log(result,err)
* })
*/
"use strict";
@atian25
atian25 / zhihu-favorites.js
Last active December 11, 2015 12:38
加载并展开知乎收藏夹
// ==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 <atian25@qq.com>
// ==/UserScript==