Skip to content

Instantly share code, notes, and snippets.

💭
I'm working on Authlib now

Hsiaoming Yang lepture

💭
I'm working on Authlib now
Block or report user

Report or block lepture

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 keybase.md

Keybase proof

I hereby claim:

  • I am lepture on github.
  • I am lepture (https://keybase.io/lepture) on keybase.
  • I have a public key whose fingerprint is 72F8 E895 A70C EBDF 4F2A DFE0 7E55 E3E0 118B 2B4C

To claim this, I am signing this object:

@lepture
lepture / hitch.rb
Last active Sep 7, 2017 — forked from steakknife/hitch.rb
Homebrew brew formula for Varnish'es Hitch TLS Proxy Server
View hitch.rb
class Hitch < Formula
desc "A scalable TLS proxy by Varnish Software"
homepage "https://github.com/varnish/hitch"
url "https://github.com/varnish/hitch/archive/hitch-1.4.6.tar.gz"
sha256 "fecc0604a2574e50e99573536eade96769b3435aa787d2095ed9115434a6f003"
head "https://github.com/varnish/hitch.git"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "pkg-config" => :build
@lepture
lepture / index.html
Created Jul 10, 2017
test-golang-fetch
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Upload</title>
</head>
<body>
<form action="/upload" method="post" enctype="multipart/form-data">
<input type="file">
<button>Submit</button>
@lepture
lepture / README.md
Last active Mar 4, 2019
Is in China
View README.md

Detecting if current browser is in China

Use the script below:

isInChina(function(inChina) {
  console.log('In china: ' + inChina);
})
@lepture
lepture / cloudflare.conf
Last active Oct 23, 2017
Cloudflare for Nginx
View cloudflare.conf
map $http_cf_visitor $cf_scheme {
'{"scheme":"http"}' http;
'{"scheme":"https"}' https;
default $http_x_forwarded_proto;
}
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
@lepture
lepture / export-june.py
Created Jul 28, 2015
export june database to JSON
View export-june.py
# code: utf-8
import json
import datetime
import pymysql
class JSONEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, datetime.datetime):
View slack-circle.py
#!/usr/bin/env python
import os
import re
import sys
import json
import requests
def parse_junit(filepath):
@lepture
lepture / slack-logger.py
Created Dec 15, 2014
Send logging to slack by webhook
View slack-logger.py
# coding: utf-8
import json
import logging
import requests
class SlackHandler(logging.Handler):
def __init__(self, url, channel, username='error', emoji='scream'):
super(SlackHandler, self).__init__()
@lepture
lepture / backup2qiniu.py
Last active Aug 31, 2015
Backup Database to Qiniu
View backup2qiniu.py
#!/usr/bin/env python
import os
import sys
import hmac
import json
import time
import hashlib
import datetime
import requests
View cordova-bridge.js
var exec = cordova.require('cordova/exec');
exec.setJsToNativeBridgeMode(exec.jsToNativeModes.XHR_OPTIONAL_PAYLOAD);
You can’t perform that action at this time.