Use the script below:
isInChina(function(inChina) {
console.log('In china: ' + inChina);
})
import re | |
import urlparse | |
def linky(url): | |
"""Sanitize link. clean utm parameters on link.""" | |
if not re.match(r'^https?:\/\/', url): | |
url = 'http://%s' % url | |
rv = urlparse.urlparse(url) |
const iframeCode = ` | |
<style>html,body{margin:0;padding:0}</style> | |
<script> | |
window.addEventListener("message", (e) => { | |
if (e.ports) { | |
const channel = e.ports[0] | |
const timestamp = e.data.init | |
channel.postMessage({'height': document.body.scrollHeight, 'timestamp': timestamp}) | |
} | |
}) |
def runserver(port=5000, profile_log=None): | |
"""Runs a development server.""" | |
from gevent.wsgi import WSGIServer | |
from werkzeug.serving import run_with_reloader | |
from werkzeug.debug import DebuggedApplication | |
from werkzeug.contrib.profiler import ProfilerMiddleware | |
port = int(port) | |
if profile_log: |
if (!process.env.NODE_PATH) { | |
console.log(); | |
if (process.env.SHELL === '/bin/zsh') { | |
console.log(' Please set environment variable NODE_PATH in ~/.zshrc:'); | |
} else if (process.env.SHELL === '/bin/bash') { | |
console.log(' Please set environment variable NODE_PATH in ~/.bashrc:'); | |
} else { | |
console.log(' Please set environment variable NODE_PATH:'); | |
} | |
console.log(); |
# https://github.com/mozilla/unicode-slugify/blob/master/slugify/__init__.py | |
import re | |
import unicodedata | |
from django.utils.encoding import smart_unicode | |
# Extra characters outside of alphanumerics that we'll allow. | |
SLUG_OK = '-_~' | |
I hereby claim:
To claim this, I am signing this object:
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; |
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 |
<!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> |