Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

e.e.p coolicer

Block or report user

Report or block coolicer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:4051ef701a41edb4fb21
SELECT TWO.STFN_ID,
LISTAGG(TWO.PDOB_NAME, ',') WITHIN GROUP (ORDER BY TWO.PDOB_NAME) "PROC"
FROM
(SELECT ONE.STFN_ID,
ONE.STFN_PARENT,
ONE.STFN_NAME,
ONE.STFN_INFO,
PROC.PDOB_NAME,
PROC.PDOB_INFO
FROM
View kj.js
var CronJob = require('cron').CronJob,
cheerio = require('cheerio'),
nodemailer = require('nodemailer'),
async = require('async'),
request = require('request'),
gbk = require('gbk')
var job = new CronJob({
cronTime: '00 30 07 * * 2,4,7', // 0 or 7 is sunday
onTick: function() {
async.waterfall([
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
@font-face {
font-family: 'SilkscreenNormal';
src: url('/static/down/slkscr-webfont.eot');
src: url('/static/down/slkscr-webfont.eot?#iefix') format('embedded-opentype'),
@coolicer
coolicer / async.js
Last active Aug 29, 2015
callback vs async
View async.js
var request = require('request');
var cheerio = require('cheerio');
var async = require('async');
var jar = request.jar();
var form;
async.waterfall([
function(callback){
request({
url : 'https://github.com/login',
View es6-generator-1.js
/*
1. Generator
可以暂停,可以重新运行。在内部暂停,在外部重新启动
普通函数只是一开始接收参数,至完成时返回。yield 返回信息,send发送信息重启
*/
function *foo() {
/*
generator跟普通函数差不多,只是多了一个*号表示这是一个generator函数。
主要的还是yield这个关键字
@coolicer
coolicer / sysctl.conf
Created Mar 21, 2015
shadowsocks 内核优化
View sysctl.conf
fs.file-max = 51200
#提高整个系统的文件限制
net.ipv4.tcp_syncookies = 1
#表示开启SYN Cookies。当出现SYN等待队列溢出时,启用cookies来处理,可防范少量SYN攻击,默认为0,表示关闭;
net.ipv4.tcp_tw_reuse = 1
#表示开启重用。允许将TIME-WAIT sockets重新用于新的TCP连接,默认为0,表示关闭;
net.ipv4.tcp_tw_recycle = 0
#表示开启TCP连接中TIME-WAIT sockets的快速回收,默认为0,表示关闭;
#为了对NAT设备更友好,建议设置为0。
net.ipv4.tcp_fin_timeout = 30
View proxy.js
if(req.url == '/data/get') {
var post_data = querystring.stringify({
proc: 'getConfig'
});
var options = {
host: '192.168.1.246',
port:80,
path: '/data/get',
method: 'POST',
View gist:aff156568274b5eaf468
# 1. 关于 SSH Server 的整体设定,包含使用的 port 啦,以及使用的密码演算方式
Port 22          # SSH 预设使用 22 这个 port,您也可以使用多的 port !
              # 亦即重复使用 port 这个设定项目即可!
Protocol 2,1        # 选择的 SSH 协议版本,可以是 1 也可以是 2 ,
              # 如果要同时支持两者,就必须要使用 2,1 这个分隔了!
#ListenAddress 0.0.0.0   # 监听的主机适配卡!举个例子来说,如果您有两个 IP,
              # 分别是 192.168.0.100 及 192.168.2.20 ,那么只想要
              # 开放 192.168.0.100 时,就可以写如同下面的样式:
ListenAddress 192.168.0.100 # 只监听来自 192.168.0.100 这个 IP 的SSH联机。
                   # 如果不使用设定的话,则预设所有接口均接受 SSH
@coolicer
coolicer / node-day-1.js
Last active Aug 29, 2015
get-weather-from-baidu
View node-day-1.js
var http = require('http'),
querystring = require('querystring'),
host = 'www.baidu.com',
path = '/home/xman/data/superload?',
cookie = 'YOUR_LOGINED_COOKIE',
o = {
"type": "weather",
"asyn": 1,
"t": new Date().getTime()
},
@coolicer
coolicer / promises-all
Created Sep 2, 2014
angular-promise-all
View promises-all
var one = $q.defer();
var two = $q.defer();
var getInStock =function(){
var params = {
proc: 'getStockCount',
param: {
type:0,
manufacturer: $scope.query.manufacturer || '',
begin: $scope.beginDay || '',
end: $scope.endDay || ''
You can’t perform that action at this time.