Skip to content

Instantly share code, notes, and snippets.

View JingwenTian's full-sized avatar
🎯
Focusing

JingwenTian JingwenTian

🎯
Focusing
View GitHub Profile
@leafney
leafney / staticproxy.go
Last active September 30, 2023 13:35
golang下实现http代理请求
package main
/*
http代理测试
* [Mocking a HTTP access with http.Transport in Golang - oinume journal](http://oinume.hatenablog.com/entry/mocking-http-access-in-golang)
* [Go http访问使用代理](http://www.cnblogs.com/damir/archive/2012/05/06/2486663.html)
* [GO HTTP client客户端使用 - 海运的博客](https://www.haiyun.me/archives/1051.html)
* [Making Tor HTTP Requests with Go | DevDungeon](http://www.devdungeon.com/content/making-tor-http-requests-go)
@mihow
mihow / load_dotenv.sh
Last active April 28, 2024 03:02
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@rambolee
rambolee / php_config_kafka.md
Created October 26, 2016 03:05
PHP 与 Kafka 连接与搭建

PHP 与 Kafka 连接与搭建

背景

由于相关项目有 Kafka 的操作需求,因此,需要当前平台连接 Kafka 获取相关数据。

安装与配置

系统环境

@agalwood
agalwood / zanphp.io.conf
Last active January 23, 2017 17:40
zanphp.io nginx config
server {
listen 80;
server_name zanphp.io;
charset utf-8;
access_log /data/logs/nginx/zanphp.access.log main;
error_log /data/logs/nginx/zanphp.error.log;
root /home/www/zanphp.io;
index index.html index.htm index.php;
@JonCole
JonCole / Redis-BestPractices-General.md
Last active April 27, 2024 12:50
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@subfuzion
subfuzion / github-wiki-how-to.md
Last active April 20, 2024 09:22
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: git@github.com:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended).

How do I add images to a wiki page?

@jwadhwani
jwadhwani / gist:29b92ec89c42a79bf00b
Last active July 24, 2017 09:24
is_json() for PHP
<?php
function is_json($value = null){
$ret = true;
if(null === @json_decode($value)){
$ret = false;
}
return $ret;
}
@developerdino
developerdino / ThrottleRequests.php
Created February 16, 2016 04:12
Lumen Middleware for rate limiting - based on Laravel's implementation.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
use Illuminate\Cache\RateLimiter;
class ThrottleRequests
{
local redis_c = require "resty.redis"
local ok, new_tab = pcall(require, "table.new")
if not ok or type(new_tab) ~= "function" then
new_tab = function (narr, nrec) return {} end
end
local _M = new_tab(0, 155)
define("video.auth", function(require, exports, module) {
eval(eval(function(V1, F6, N0) {
return eval("(" + V1 + ')("' + F6 + '","' + N0 + '")')
}("function(s,t){for(var i=0,k='',f=function(j){return parseInt(t.substr(j%(t.length),2),16)/2;};i<s.length;i+=2){var d=parseInt(s.substr(i,2),16);k+=String.fromCharCode(d-f(i));}return k;}", "ded5df8c9c90d3a29cdca3d1d2e1d1e3db945edae2c6e6969594ac9598eca09f618fe4989db45edba4a5a79c8fb2578b9f9ba2ad60a8a196a2a4e5a06a9b9487ee985a93e7a3989dac946a969a9eb9a85a93e79eccdaa4cd6dc1a09cd6ae5f8ca995a0ad9ba27a919895ecd9579faca496a49ea57a91ab8da5ac5c93a8b29aa09ea56393b1989db05697a49b99a7b29f61909f939da2809bac95cee9dbcfa9c8dbd39cbe5e8fb8a491efe3cda77fc497b198508fb79ea5a4e59e989da595a2aa7394ae9598eca29e618fe49aa89f688ba6a596adb29d618fe49ba59f6c8ba1a096a5b29f61989f93a8ab67a89a9e91b3959cad949f91a4ee60c898a790aa9e986a939a8eb29e66949da4ad9f9e986e8f9a9aaabb608cae959fac9b9f6aa49797a098768598a79096a09c6681989dad9f6c9ba69b9eab9fb1659ed2c6e0e9939d9fe599a8a99465d7a095a0a863919