Instantly share code, notes, and snippets.

View hosts
127.0.0.1 clien.net
127.0.0.1 namu.wiki
127.0.0.1 pgr21.com
View build_proxygen_on_macos.sh
#!/bin/bash
set -x
# homebrew dependencies
brew install cmake pkgconfig automake openssl md5sha1sum
brew install autoconf-archive libtool wget boost libsodium folly
OPENSSL_DIR="$(brew --prefix openssl)"
View common_ssl_setting.conf
ssl_certificate /etc/letsencrypt/live/foo.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/foo.com/privkey.pem;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 5m;
# Enable server-side protection against BEAST attacks
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
View match-score.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
alphabet_to_num = {
'A': 3,
'B': 3,
'C': 1,
'D': 2,
View no-work-posession.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def geometric_coeff(percentage, n):
if percentage != 0:
ratio = percentage / 100.0
return float((1 + ratio) ** n - 1) / ratio
else:
return n
View gist:b834bfac2b3c7ee8ab46
import com.twitter.util.Future
var seq = Future(Seq(1,2,3))
seq map { s => Map(s map {x => x -> x * 2}): _*) }