Skip to content

Instantly share code, notes, and snippets.

@husio
husio / client.html
Created October 12, 2012 14:01
Websocket proxy
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Websockproxy test</title>
<script type="text/javascript" charset="utf-8">
window.onload = function () {
var ws = new WebSocket('ws://' + document.location.host + '/ws');
ws.onopen = function (ev) {
#unbind C-b
#set -g prefix C-a
bind s split-window -v
bind v split-window -h
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
@husio
husio / index.html
Created October 2, 2012 16:44
server.go
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Index</title>
<script src="http://code.jquery.com/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var players = {};
var myid = prompt("Nick:");
@husio
husio / gist:3756028
Created September 20, 2012 13:47
Xdefaults
Xft.antialias: true
Xft.hinting: true
Xft.hintstyle: hintfull
Xft.rgba: rgb
*cursorBlink: false
*scrollBar: false
!*utf8: 2
*termName: xterm-256color
#!/bin/bash
if [ $# -eq 0 ]
then
echo ""
echo " 1. Radio TOK FM (alias: tokfm)"
echo " 2. RMF FM (alias:rmffm)"
echo " 3. Jedynka (alias: jedynka)"
@husio
husio / json_format.py
Created July 6, 2012 13:40
Pretty print of any JSON
#!/usr/bin/env python
import sys
import json
import pprint
import urllib
def main():
if len(sys.argv) == 2:
@husio
husio / sql_format.py
Created July 4, 2012 08:04
Pretty print of any SQL
#!/usr/bin/env python
import os
import sys
import urllib
import urllib2
url = 'http://sqlformat.appspot.com/format/'
Xft*dpi: 100
Xft*antialias: true
Xft.hinting: hintfull
#Xft.hintstyle: 5
Xft*lcdfilter: 5
Xft*minspace: true
# {{{ ncmpc
ncmpc*faceName: fixed
ncmpc*faceSize: 8
-- Standard awesome library
require("awful")
require("awful.autofocus")
require("awful.rules")
-- Widget and layout library
require("wibox")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
@husio
husio / remotenotify.py
Created April 2, 2012 16:10
Remote irssi notification (SSH + libnotify)
#!/usr/bin/env python2
import optparse
import re
import select
import sys
import socket
import time
import paramiko