Skip to content

Instantly share code, notes, and snippets.

@Muuo
Muuo / today
Created January 1, 2017 00:51
A simple script that lets me edit timestamped files in Vim
#!/bin/sh
numargs=$#
t='today'
secFlag=''
editPath='.'
pos=1
while getopts ':sd' flag; do
case "${flag}" in
@Muuo
Muuo / nginx.conf
Created December 9, 2015 20:40
Enforce HTTPS in Bluemix
worker_processes 1;
daemon off;
error_log <%= ENV["APP_ROOT"] %>/nginx/logs/error.log;
events { worker_connections 1024; }
http {
log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent';
access_log <%= ENV["APP_ROOT"] %>/nginx/logs/access.log cloudfoundry;
default_type application/octet-stream;
from random import shuffle, randint
import re
from sets import Set
def f1(seq): # Raymond Hettinger
# not order preserving
set = {}
map(set.__setitem__, seq, [])
return set.keys()