Skip to content

Instantly share code, notes, and snippets.

View btbytes's full-sized avatar
🐎
🏈

Pradeep Gowda btbytes

🐎
🏈
View GitHub Profile
@igorw
igorw / turel.clj
Last active August 29, 2015 13:57
(ns turel.core
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn not-membero
[x l]
(conde [(emptyo l)]
[(fresh [head tail]
(conso head tail l)
(!= head x)
@wei2912
wei2912 / intro.lhs
Last active August 29, 2015 14:09
Update with link to my blog.
# Shifted this file to my blog
The new link is on my blog: https://wei2912.github.io/index.html#introduction_to_haskell
I'll update the post on my blog from now on.
---
Introduction to Haskell
---
#!/usr/bin/perl -w
# vim:et:sw=4 ts=4
# servermenu_pl - an server menu example client for LCDproc
# Displays some server stats: mem, cpu, local time
# and offers the possibility to shutdown the machine via
# the buttons.
# Copyright GPL 2005, Guido Socher
use IO::Socket;
use Getopt::Std;
use Fcntl;
@btbytes
btbytes / siri_words.markdown
Created January 9, 2011 15:42
Siri Words

My 13 month old daughter Siri speaks these words, in three languages :

  • kn = Kannada (Pradeep's Mother tongue)
  • ko = Konkani (Nayan's Mother tongue)
  • en = English
  • ba = Baby talk

2011-01-09

@philikon
philikon / wtf8.py
Created February 8, 2011 08:22
WTF-8 codec for Python
# wtf8.py
import codecs
def encode(input, errors='strict'):
return input.encode('utf-8', errors).decode('latin-1', errors).encode('utf-8', errors), len(input)
def decode(input, errors='strict'):
return input.decode('utf-8', errors).encode('latin-1', errors).decode('utf-8', errors), len(input)
class StreamWriter(codecs.StreamWriter):
@btbytes
btbytes / kill_idle_pg.sh
Created April 6, 2011 14:17
Kill the oldest postgresql idle transaction if there are more than 5 such processes.
/usr/bin/test `/usr/bin/pgrep -f 'idle in transaction' | \
/usr/bin/wc \-l ` \-gt 5 && /usr/bin/pkill \-o \-f 'idle in transaction'
@btbytes
btbytes / couchdb-tunnel.pl
Created May 17, 2011 15:23
A SysV init script to run a SSH Tunnel. A useful example of using Perl to write init scripts.
#!/usr/bin/perl
# CouchDB Tunnel Tool for MacOS X and Linux
# Copyright (c) 2010 Linode, LLC
# Author: Philip C. Paradis <pparadis@linode.com>
# Modifications: Sam Kleinman <sam@linode.com>
# Usage: couchdb-tunnel.pl [start|stop]
# Access a CouchDB database instance by way of an SSH tunnel.
##
@micrypt
micrypt / gist:1048924
Created June 27, 2011 14:10
Riak Quick Start from GitHub
# Install Erlang
$ sudo apt-get install autoconf
$ curl -O https://raw.github.com/dreverri/kerl/master/kerl; chmod a+x kerl
$ ./kerl build R14B03 r14b03
$ ./kerl install r14b03 /opt/erlang/r14b03
$ . ~/.kerl/installs/r14b03/activate
# Build Riak from source
$ git clone git://github.com/basho/riak.git
$ cd riak
# args is sys.argv[1:]
def foo(config, args):
config.domain = None
config.fullurl = None
hostname = None
it = iter(args)
while True:
try:
arg = next(it)
@nikcub
nikcub / admin.less
Created November 11, 2011 00:13
example bootstrap file
// to build:
// lessc <filename> > site.css
// lessc <filename> > site.min.css --compress
// the swatch
@color1: #55626b;
@color2: #6c9380;
@color3: #c1ca55;
@color4: #f07d6b;
@color5: #ad5472;