This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'logger' | |
require 'rbcurse' | |
require 'rbcurse/core/widgets/rmessagebox' | |
if $0 == __FILE__ | |
# Initialize curses | |
# some helper methods for working with stdlib FILE pointers | |
module CLib | |
extend FFI::Library | |
ffi_lib FFI::Library::LIBC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
for file ( *.flac ) { | |
print $file | |
newf=${file/flac/m4a} | |
ffmpeg -i $file $newf | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -w | |
=begin | |
* Name : lastpara.rb | |
* Description : splits a file into paras based on a blank line and prints last one | |
* Author : rkumar | |
* Date : 2012-12-08 - 12:54 | |
* Last update : 2012-12-08 17:00 | |
* License : | |
Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# ----------------------------------------------------------------------------- # | |
# File: listquery | |
# Description: list files with query on size and age | |
# Author: rkumar http://github.com/rkumar/rbcurse/ | |
# Date: 2012-12-05 - 19:38 | |
# License: Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt) | |
# Last update: 2012-12-06 00:52 | |
# ----------------------------------------------------------------------------- # | |
# listquery Copyright (C) 2012 rahul kumar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# maintains a jump-list of the directories you actually use | |
# | |
# INSTALL: | |
# * put something like this in your .bashrc: | |
# . /path/to/z.sh | |
# In .zshrc, add the following. | |
#source ~/bin/z.sh | |
#function precwd () ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/Library/Formula | |
# take out depends, removed everything other than dep, use awk to subtotal, sort on dep count | |
grep -h depends_on *.rb | sed 's/depends_on//g;s/=>//g' | tr -d "':\"" | awk '{ print $1}' | sort | subtotal.sh | sort -k 2 -n -t : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# compute and print total occurrences for words in list | |
# e.g. dependincies or uses in brew | |
awk '{a[$1] ++} END{for (i in a) printf " %s: %2d \n",i, a[i]}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# ----------------------------------------------------------------------------- # | |
# File: list | |
# Description: wrapper over 'ls' so I don't have to remember zsh's great expansions | |
# Author: rkumar http://github.com/rkumar/rbcurse/ | |
# Date: 2012-12-02 - 17:07 | |
# Last update: 2012-12-02 - 17:08 | |
# License: Free | |
# If you want to use 'v', get from https://gist.github.com/4188977 | |
# ----------------------------------------------------------------------------- # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Dec 22, 2011 | |
# Display recent files from viminfo and prompt for editing | |
[ "$vim" ] || vim=vim | |
[ $viminfo ] || viminfo=~/.viminfo | |
usage="$(basename $0) [-a] [-l] [-[0-9]] [--debug] [--help] [regexes]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Add this to your vimrc file | |
" auto-update "Last update: " if present whenever saving file | |
autocmd! BufWritePre * :call s:timestamp() | |
" to update timestamp when saving if its in the first 5 lines of a file | |
function! s:timestamp() | |
let pat = '\(Last update\s*:\s*\).*' | |
let rep = '\1' . strftime("%Y-%m-%d %H:%M") | |
call s:subst(1, 5, pat, rep) | |
endfunction |
NewerOlder