Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

e.e.p coolicer

🎯
Focusing
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
@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 || ''
@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()
},
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
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 es6-generator-1.js
/*
1. Generator
可以暂停,可以重新运行。在内部暂停,在外部重新启动
普通函数只是一开始接收参数,至完成时返回。yield 返回信息,send发送信息重启
*/
function *foo() {
/*
generator跟普通函数差不多,只是多了一个*号表示这是一个generator函数。
主要的还是yield这个关键字
@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 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'),
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 gist:073bd830ea45895ee467
var datasource = [{
"text": "null",//根节点
"expanded": true,
"items": [
{
"text":"user1",//第一个子菜单
"expanded": true,
"items":[
{
"text":"user2",//二级菜单
@coolicer
coolicer / gist:2020975
Created Mar 12, 2012
HTML : Starting Template
View gist:2020975
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
</body>
You can’t perform that action at this time.