Skip to content

Instantly share code, notes, and snippets.

View typeshige's full-sized avatar

Shige Abe typeshige

  • Silicon Valley, CA
View GitHub Profile
function! InsertTabWrapper(direction)
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
elseif "backward" == a:direction
return "\<c-p>"
else
return "\<c-n>"
endif
endfunction
@typeshige
typeshige / check_for_updates.py
Created March 20, 2012 17:17 — forked from coordt/check_for_updates.py
Check locally installed packages against one or more package indexes for updates and list them.
#!/usr/bin/env python
"""
Use pip to get a list of local packages to check against one or more package
indexes for updated versions.
"""
import pip
import sys, xmlrpclib
from cStringIO import StringIO
from distutils.version import StrictVersion, LooseVersion
@typeshige
typeshige / itunes_export_fixer.py
Created August 6, 2012 18:54
Convert an itunes export into csv for Excel.
#!/usr/bin/python
file = open('0.txt', 'rb')
lines = []
for line in file:
lines.append(line)
bigline = ''.join(lines)
lines = bigline.split('\r')
server {
listen 80;
server_name %(name)s %(aliases)s;
client_max_body_size 4G;
keepalive_timeout 5;
gzip on;
gzip_static on;
gzip_min_length 1000;
gzip_types text/css text/plain text/javascript application/x-javascript application/x-json;
server {
listen 80;
server_name <url>;
root /var/www/html;
location / {
@typeshige
typeshige / Monaco-Powerline.otf
Created October 2, 2012 17:01 — forked from baopham/Monaco for Powerline.otf
Patched font Monaco for OSX Vim-Powerline
@typeshige
typeshige / index.html
Created October 24, 2012 17:47 — forked from slojo404/index.html
Timeline using d3.js
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Chronological Diagram of Asia</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style type="text/css">
.chart {
shape-rendering: crispEdges;
}

Serving Django and Twisted using HAproxy

  • on the same IP
  • on the same Port 80

Why?

coming...

Who?

Tested only on Ubuntu 20.04, KDE Neon User Edition (based on Ubuntu 20.04) and OSX Mojave.

will probably work on other newer versions, with no changes, or with few changes in non-python dependencies (apt-get packages)

NOTE: Don't create a .sh file and run it all at once. It will not work. Copy, paste, and execute each command below manually. :-)

Ubuntu

# DO NOT RUN THIS AS A ROOT USER