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 / gist:9670423a725a35d844fe4d9e5189800a
Created August 31, 2016 07:07 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@atian25
atian25 / z-automator.png
Created August 31, 2016 07:06 — forked from lrytz/z-automator.png
Shortcut for Syntax Highlighting in Keynote
@atian25
atian25 / set-header.js
Created August 31, 2016 03:20 — forked from fengmk2/set-header.js
set header benchmark
'use strict';
const OutgoingMessage = require('http').OutgoingMessage;
'use strict';
const Benchmark = require('benchmark');
const benchmarks = require('beautify-benchmark');
const suite = new Benchmark.Suite();
@atian25
atian25 / README.md
Created March 9, 2016 14:07 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
'use strict';
var swig = require('swig');
var expect = require('expect.js');
describe('test', function() {
var compileFn = function(compiler, args, content, parents, options, blockName) {
return ';_output += "<div"' + JSON.stringify(args) + '+">";' + compiler(content, parents, options, blockName) + ';' + '_output += "</div>";';
};
@atian25
atian25 / gist:63feefc9613a67f412c6
Created July 7, 2015 08:27
js 奇葩技巧之隐藏代码
//http://www.cnblogs.com/52cik/p/js-hide-code.html
(function(window) {
var rep = { // 替换用的数据,使用了4个零宽字符,数据量减少了一半。
'00': '\u200b',
'01': '\u200c',
'10': '\u200d',
'11': '\uFEFF'
};
function hide(str) {
@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 / 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: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
/**
* 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] 格式