Skip to content

Instantly share code, notes, and snippets.

View ramananbalakrishnan's full-sized avatar

Ramanan Balakrishnan ramananbalakrishnan

View GitHub Profile
@ramananbalakrishnan
ramananbalakrishnan / diff-highlight
Created February 18, 2016 08:14
Good looking diff using diff-highlight (based on so-fancy/diff-so-fancy)
#!/usr/bin/perl
use 5.008;
use warnings FATAL => 'all';
use strict;
# Highlight by reversing foreground and background. You could do
# other things like bold or underline if you prefer.
my @OLD_HIGHLIGHT = (
color_config('color.diff-highlight.oldnormal'),
@ramananbalakrishnan
ramananbalakrishnan / keybase.md
Last active April 20, 2017 11:22
keybase proof

Keybase proof

I hereby claim:

  • I am ramananbalakrishnan on github.
  • I am ramanan (https://keybase.io/ramanan) on keybase.
  • I have a public key whose fingerprint is 9801 F3A9 7336 7EEB B7F4 F28E 5728 3041 B6B6 D1D1

To claim this, I am signing this object:

@ramananbalakrishnan
ramananbalakrishnan / findSortMerge.sh
Last active August 29, 2015 14:26
Find all files modified within certain dates , sort them according to time, pick certain filenames and concatenate the gzipped files
cat `find ./ -newermt "2015-07-29 19:30" -not -newermt "2015-07-30 06:46" -type f -printf '%T@ %p\n' |\
sort -k1 -n |\
grep 'access.log.*.gz' |\
awk '{print $2}'` > ~/outputFile.gz
ShopifyAPI::Customer.find_all do |customer|
# do something with the customer
end
ShopifyAPI::Order.find_all(:status => :any) do |order|
# do something with the order
end
ShopifyAPI::Product.find_all(:limit => 250) do |product|
# do something with the product
@ramananbalakrishnan
ramananbalakrishnan / git-multi-status.sh
Last active June 22, 2016 18:11 — forked from c0wfunk/git-multi-status.sh
check the status of all git repositories located under a given directory (default: cwd)
#!/bin/bash
# usage: $0 [source_dir] ...
# where source_dir args are directories containing git repositories
red="\033[00;31m"
green="\033[00;32m"
yellow="\033[00;33m"
blue="\033[00;34m"
purple="\033[00;35m"
cyan="\033[00;36m"