Skip to content

Instantly share code, notes, and snippets.

View ETiV's full-sized avatar
🛥️
船迟又遇打头风

ETiV

🛥️
船迟又遇打头风
  • Shanghai, China
  • 08:57 (UTC +08:00)
View GitHub Profile
@ETiV
ETiV / IRremote-fan-speed.ino
Created March 31, 2014 06:09
红外遥控器控制风扇转速. 红外信号针脚接11, 马达正极接6.
#include <IRremote.h>
int RECV_PIN = 11;
int MOTOR_PIN = 6;
IRrecv irrecv(RECV_PIN);
decode_results results;
const int analogMin = 0;
const int analogMax = 255;
@ETiV
ETiV / kill-test-sender.js
Created April 8, 2014 18:14
测试 NodeJS 支持的 kill signals
/**
* Created by ETiV on 4/9/14.
*/
var target_pid = 26263;
var signals = ['SIGHUP',
'SIGINT',
'SIGQUIT',
'SIGILL',
@ETiV
ETiV / Install.nginx.sh
Last active August 29, 2015 13:59
快速创建服务器环境, 使用 sudo 执行
# nginx version 1.6.0
# http://nginx.org/download/nginx-1.6.0.tar.gz
# Install GD Library, GeoIP, SSL-dev
# apt-get install -y libgd2-xpm-dev libgeoip-dev libssl-dev
./configure --prefix=/srv/nginx --user=www --group=www --with-poll_module --with-file-aio --with-http_ssl_module --with-http_spdy_module --with-http_realip_module \
--with-http_addition_module --with-http_image_filter_module --with-http_geoip_module --with-http_dav_module --with-http_flv_module \
--with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module \
--with-http_secure_link_module --with-mail --with-pcre
@ETiV
ETiV / Direct_Links_in_Google_Search.user.js
Last active August 29, 2015 14:25 — forked from astanin/Direct_Links_in_Google_Search.user.js
Remove indirections from Google search results on all TLDs (GreaseMonkey script)
@ETiV
ETiV / zimuzu-auto-sign.js
Created September 2, 2015 09:56
ZiMuZu.tv auto-dosign script in javascript. (NodeJS)
// First, setup username and password.
// Second, run command `npm link request` to install the depends
// Then, setup cronjob for auto checkin everyday.
var USERNAME = '_FILL_ME_';
var PASSWORD = '_FILL_ME_';
var request = require('request');
request = request.defaults({
jar: true
function parseQueryString(qs) {
qs = qs.replace(/\+/g, ' ');
var params = {}, tokens,
re = /[?&]:?([^=]+)=([^&]*)/g;
while (tokens = re.exec(qs)) {
// console.log(tokens);
params[decodeURIComponent(tokens[1])]
= decodeURIComponent(tokens[2]);
@ETiV
ETiV / pomelo_filter_template.js
Last active December 15, 2015 13:19
A template of filter for pomelo framework.
/**
* Filter
*/
module.exports = function() {
return new Filter();
};
var Filter = function() {
};
@ETiV
ETiV / Vim-Run-NodeJS.vim
Created April 11, 2013 18:32
run the current js file by pressing F2 key with nodejs
autocmd filetype javascript map <F2> :!node "%:p"<CR>
@ETiV
ETiV / goagent.plist
Created April 23, 2013 04:21
my goagent auto launch configuration file of osx. under path "/Library/LaunchDaemons". to check run `launchctl list | grep GoAgent`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>GoAgent</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python</string>
@ETiV
ETiV / invoke_callback.js
Created May 6, 2013 09:10
javascript invoke callback
var __callback = function (cb) {
if (typeof cb == 'function') {
delete arguments['0'];
var args = [];
for (var key in arguments) {
if (arguments.hasOwnProperty(key)) {
args.push(arguments[key]);
}
}
cb.apply(null, args);