Skip to content

Instantly share code, notes, and snippets.

View karuna's full-sized avatar
🦡
Badger Badger Badger

Karuna Murti karuna

🦡
Badger Badger Badger
View GitHub Profile

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@karuna
karuna / .gitconfig
Last active August 29, 2015 14:08
minimum git config
[core]
editor = vi
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%C(yellow)%h%Creset %ad | %Cgreen%s%Creset%d %Cred[%cn - %ce]%Creset\" --graph --date=iso --decorate
history = log --pretty=format:\"%C(yellow)%h%Creset %ad | %Cgreen%s%Creset%d %Cred[%cn - %ce]%Creset\" --graph --date=iso --decorate
type = cat-file -t
@karuna
karuna / wrapper.sh
Created May 10, 2015 11:26
Linux Desktop Notification for long bash command
# usage: wrapper command
# e.g. wrapper cap production deploy
# put this on your .bashrc
wrapper(){
start=$(date +%s)
"$@"
[ $(($(date +%s) - start)) -le 15 ] || notify-send "Notification" "Long\
running command \"$(echo $@)\" took $(($(date +%s) - start)) seconds to finish"
}
// npm install node-gpsd
var gpsd = require('node-gpsd');
var gpsData = "No GPS data received.";
var gpsListener = new gpsd.Listener({
port: 2947,
hostname: 'localhost'
});
function startGPS () {
@karuna
karuna / wave.c
Created July 5, 2015 10:37
wave radio for indonesia
#include <math.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <machine/speaker.h>
#define SPEAKER "/dev/speaker"
static struct tm *ptmOurs;
#app/helpers/application_helper.rb
module ApplicationHelper
def money_format money
number_to_currency(money.to_f, :unit => "&pound;", :separator => ",", :delimiter => "", :precision => 2)
end
end
@karuna
karuna / gist:cdd47fe1664349907bcb
Created September 27, 2015 06:54
new bash prompt
set_prompt (){
red="\[\033[38;5;1m\]"
green="\[\033[38;5;10m\]"
yellow="\[\033[38;5;11m\]"
grape="\[\033[38;5;92m\]"
strawberry="\[\033[38;5;9m\]"
mellon="\[\033[38;5;162m\]"
name="$red🍒$space$green🍏$space$red🍓$space$color4"
host="$color3\h$color4"
path="$color5\w$color4"
@karuna
karuna / Custom.css
Created March 12, 2012 02:33
IR_Black Theme for Chrome Developer Tools (modified)
/*
*
* Edited by Abderrahmane TAHRI JOUTI (tj.abderrahmane@gmail.com)
* http://abderrahmane-tj.co.cc
*
*/
/**********************************************/
/*
@karuna
karuna / Custom.css
Created March 12, 2012 02:38 — forked from bentruyman/Custom.css
Tomorrow Theme for Chrome Developer Tools
/**********************************************/
/*
/* Tomorrow Skin by Ben Truyman - 2011
/*
/* Based on Chris Kempson's Tomorrow Theme:
/* https://github.com/ChrisKempson/Tomorrow-Theme
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@karuna
karuna / gist:4147776
Created November 26, 2012 11:35
Github userstyles
.container, body.api #wrapper, body.platform-switch #content-wrapper, .container .discussion-timeline {
width:90% !important
}
#slider .frames .frame, #slider .frames, body.platform-switch #content-wrapper .site, .container .file-commit-form {
width:100% !important
}
.frame[style*="margin-left: -1200px;"] {
visibility: hidden !important;
display: none !important
}