Skip to content

Instantly share code, notes, and snippets.

View rkumar's full-sized avatar
💭
Coming back to this world after a long time

r__k_u_m_a_r rkumar

💭
Coming back to this world after a long time
View GitHub Profile
@rkumar
rkumar / gist:226180
Created November 4, 2009 16:35
paste a sig into a sig file
#!/bin/bash
#*******************************************************#
# #
# #
# Arunachalesha #
# $Id$ #
#*******************************************************#
file="$HOME/myblogs/totalrecall/techurls.txt"
sig=`pbpaste`
if [ "$sig" == "" ]
@rkumar
rkumar / get_serial_number.sh
Created November 6, 2009 10:20
generate serial numbers
#!/bin/bash
## returns a serial number based on a file
## can be used for programs requiring a running id
## different apps can have their own serial numbers
## different folders can have their serial number file
# == PROCESS OPTIONS ==
Revision="0.1"
Date="2009-11-06"
arg0=$(basename "$0")
istart=1
@rkumar
rkumar / todo.sh
Created November 6, 2009 10:30
todo.txt-cli clone
#! /bin/bash
# NOTE: Todo.sh requires the todo.cfg configuration file to run.
# Place the todo.cfg file in your home directory or use the -d option for a custom location.
# incr_id is a program that returns a sequential id each time it is called
# it is as follows
##!/bin/bash
#file=~/bin/unique_id
#uniqueid=`cat $file`
#let nextid=$uniqueid+1
@rkumar
rkumar / sh.snippets
Created December 5, 2009 02:36
snipMate snippet for bash scripts (refer snipMate plugin)
# #!/bin/bash
snippet #!
#!/bin/bash
snippet if
if [[ ${1:condition} ]]; then
${2:#statements}
fi
snippet ife
if [[ ${1:condition} ]]; then
@rkumar
rkumar / tumblr.sh
Created January 1, 2010 15:01
a command-line tumblr client using bash shell
#!/bin/bash
## vim:ts=4:sw=4:tw=100:ai:nowrap:formatoptions=croqln:
#*******************************************************#
# tumblr.sh #
# written by Rahul Kumar #
# 2010/01/01 #
# Post, edit, delete, read tumblr.com #
#*******************************************************#
# References: http://www.tumblr.com/api#api_write
# DONE : add read
@rkumar
rkumar / gist:312464
Created February 23, 2010 17:43
some old ncurses io routines i might use at some time
=begin
* Name: commonio.rb
* $Id$
* Description Common io routine ncurses (old)
* Author: rkumar
* Date: 2008-11-13 13:33
* License:
Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
=end
@rkumar
rkumar / gist:312468
Created February 23, 2010 17:45
ncurses common io routines
#*******************************************************#
# Note: all method here require the presence of a footer_win
# and header_win to have been created,
# with the exception of print_help_page.
#
# Arunachalesha
# $Id$ #
#*******************************************************#
module Commons1
@rkumar
rkumar / gist:356056
Created April 5, 2010 05:16
youtube downloader using gawk
#!/usr/bin/gawk -f
#
# 2007.07.10 v1.0 - initial release
# 2007.10.21 v1.1 - youtube changed the way it displays vids
# 2008.03.01 v1.2 - youtube changed the way it displays vids
# 2008.08.28 v1.3 - added a progress bar and removed need for --re-interval
# 2009.08.25 v1.4 - youtube changed the way it displays vids
# 2010.04.05 - youtube changes video_url format
#
# Peteris Krumins (peter@catonmat.net)
@rkumar
rkumar / gist:418831
Created May 30, 2010 06:22
color.rb - coloring on terminal or console
#!/usr/bin/env ruby -w
# A module that helps in printing colored output onto the console.
# Preferable to use highline gem. For small usage, you can just cut
# paste this module into your program and include it.
# Most of this is stolen from the highline project.
module Color
CLEAR = "\e[0m"
# An alias for CLEAR.
RESET = CLEAR
@rkumar
rkumar / gist:418841
Created May 30, 2010 06:49
colorconst.rb - constants so we can print colored text onto console in ruby
#!/usr/bin/env ruby
# Color constants so we can print onto console using print or puts
# @example
# string = "hello ruby"
# puts " #{RED}#{BOLD}#{UNDERLINE}#{string}#{CLEAR}"
#
# ripped off highline gem
module ColorConstants