This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
from pathlib import Path | |
import time | |
import traceback | |
from urllib import request | |
from urllib.parse import urlencode | |
from bs4 import BeautifulSoup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bs4 | |
python-twitter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# calc base64-encoded sha384 hash of a file | |
base64sha384 () { | |
openssl dgst -sha384 -binary < $1 | openssl enc -base64 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 clien.net | |
127.0.0.1 namu.wiki | |
127.0.0.1 pgr21.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
alphabet_to_num = { | |
'A': 3, | |
'B': 3, | |
'C': 1, | |
'D': 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.twitter.util.Future | |
var seq = Future(Seq(1,2,3)) | |
seq map { s => Map(s map {x => x -> x * 2}): _*) } |