Skip to content

Instantly share code, notes, and snippets.

View htom78's full-sized avatar

htom78

View GitHub Profile
@wzed
wzed / guzzle_pool_example.php
Created February 8, 2017 08:57
GuzzleHttp\Pool example: identifying responses to concurrent async requests
<?php
/*
* Using a key => value pair with the yield keyword is
* the cleanest method I could find to add identifiers or tags
* to asynchronous concurrent requests in Guzzle,
* so you can identify which response is from which request!
*/
$client = new GuzzleHttp\Client(['base_uri' => 'http://httpbin.org']);
@sorrycc
sorrycc / config.js
Created October 30, 2014 10:02
spm build script
var join = require('path').join;
var DEFAULT_CONFIG = {
// spm 源
"registry": "http://private-spm-url",
// Rename files
// 详见:https://github.com/jeremyruppel/pathmap
"pathmap": null,
var AppConstants = require('../constants/AppConstants.js');
var AppDispatcher = require('../dispatchers/AppDispatcher.js');
var api = require('../utils/api');
var ActionTypes = AppConstants.ActionTypes;
module.exports = {
create_customer: function(data){
api.customer.create(data);
}
@nolimits4web
nolimits4web / Framework7 Plugin Barebon
Created May 31, 2014 12:07
Framework7 Plugin Barebone
/*==================================================
* Awesome Plugin 1.0.0
* Awesome plugin for Framework7 0.8.6+
*
* http://www.path.to/plugin/home/page
*
* Copyright 2010-2014, John Doe
* The Company
* http://www.path.to/developer/home/page
*

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
@hwdsl2
hwdsl2 / .MOVED.md
Last active May 19, 2024 06:28
IPsec VPN Server Auto Setup Script for Ubuntu and Debian
@wen-long
wen-long / ss-redir 透明代理.md
Last active March 18, 2024 12:13
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
var get = Ember.get;
/**
@extends Ember.Mixin
Implements common pagination management properties for controllers.
*/
Ember.PaginationSupport = Ember.Mixin.create({
/**
*/
@insin
insin / app.js
Last active February 11, 2022 15:40
Pagination Test With React.js
/** @jsx React.DOM */
var App = React.createClass({
getInitialState: function() {
return {
pageSize: 2
}
}
, render: function() {
@xero
xero / ajaxBackboneHandlebars.js
Created August 8, 2013 14:03
load a handlebars template via ajax then use it as a backbone view
$.ajax({
url: 'ui/tpl/login.handlebars',
context: this,
cache: true,
success: function(data) {
var tpl = Handlebars.compile(data);
this.$el.html(tpl(this.model.toJSON()));
}
});