Skip to content

Instantly share code, notes, and snippets.

@guileen
guileen / supervisor.sh
Last active August 29, 2015 13:56 — forked from keimlink/gist:831633
/etc/init.d/supervisord
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36
@guileen
guileen / layout.jade
Created May 3, 2014 10:28
bootstrap blog layout
!!! 5
html(lang='en')
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
meta(name='viewport', content='width=device-width, initial-scale=1')
meta(name='description', content='')
meta(name='author', content='')
link(rel='shortcut icon', href='../../assets/ico/favicon.ico')
title Blog Template for Bootstrap
@guileen
guileen / http-proxy-log
Last active August 29, 2015 14:01
http proxy for log
var http = require('http');
var httpProxy = require('http-proxy');
var proxy = httpProxy.createProxyServer({});
var cclog = require('cclog');
var fs = require('fs');
var zlib = require('zlib');
var i = 1;
http.createServer(function(req, res) {
// req.setEncoding('utf-8');
@guileen
guileen / android_monitor_uninstall.cpp
Last active August 29, 2015 14:05
http://www.cnblogs.com/zealotrouge/p/3159772.html 思路是今天想到了一个Android自API1就有的一个类FileObserver,这个类用于监听某个文件的变化状态,如果是目录,这个类还可以监听其子目录及子目录文件的变化状态,通过阅读FileObserver源码,发现其实现利用了Linux内核中一个重要的机制inotify,它是一个内核用于通知用户空间程序文件系统变化的机制
/* 头文件begin */
#include "main_activity_UninstalledObserverActivity.h"
/* 头文件end */
#ifdef __cplusplus
extern "C" {
#endif
/* 内全局变量begin */
static char c_TAG[] = "UninstalledObserverActivity.init";
//// https://github.com/FasterXML/jackson-databind/blob/master/src/main/java/com/fasterxml/jackson/databind/util/ISO8601Utils.java
package com.fasterxml.jackson.databind.util;
import java.util.*;
import java.text.ParsePosition;
import java.text.ParseException;
/**
* Utilities methods for manipulating dates in iso8601 format. This is much much faster and GC friendly than
;(function() {
/*
* Author: Gui Lin
* guileen AT gmail DOT com
*/
function $ (selector, el) {
return (el||document).querySelector(selector);
}
function $$ (selector, el) {
@guileen
guileen / another-stage.js
Created September 14, 2014 16:55
Another stage js from some guy.
/**
* 全局变量
*/
var AG_debug = false;
var AG_time = 0;
var AG_startTime = 0;
var AG_running = false;
var AG_stages = [];
var AG_bufCanvas = null;
var AG_bufCtx = null;
@guileen
guileen / chat.go
Last active August 29, 2015 14:13
package main
import (
"bufio"
"net"
)
type Client struct {
incoming chan string
outgoing chan string
@guileen
guileen / tcpdemo.go
Last active August 29, 2015 14:13
TCP服务端demo
package main
import (
"bufio"
"fmt"
"io"
"net"
)
type Client struct {
@guileen
guileen / XXTea.cs
Last active August 29, 2015 14:16 — forked from lski/XXTea.cs
using System;
using System.Text;
/// <summary>
/// A class for encrypting and decrypting a string into base64 format which makes it safe for transfer
/// between applications.
///
/// Reference:
/// Based upon the javascript implementation of xxtea by: Chris Veness
/// www.movable-type.co.uk/tea-block.html