Skip to content

Instantly share code, notes, and snippets.

View irfn's full-sized avatar
🤩
stargazing!

Irfan Shah irfn

🤩
stargazing!
  • base14.io
  • Bangalore
View GitHub Profile
@irfn
irfn / iptoweather
Created January 7, 2014 04:35
ip to weather
var locate = function(locationInfo) {
var city = locationInfo.city.replace(" ", "_");
var region = locationInfo.region;
$.get('http://api.wunderground.com/api/91425b2b253b294f/forecast/q/'+region+'/'+city+'.json', function(response) {
console.log(response.forecast.forecastday)})
});
}
$.get('http://ip-api.com/json/199.48.152.51?callback=locate')
touch ~/.zshmarks && source ~/.zshmarks
function b() {
echo "hash -d $1=\"`pwd`\"" >> ~/.zshmarks && source ~/.zshmarks
}
@irfn
irfn / gist:5625747
Created May 22, 2013 07:03
.tmux.conf
set-option -g prefix `
# set-option -g prefix C-a
unbind-key C-b
bind-key C-a last-window
bind-key ` last-window
bind-key a send-prefix
# 0 is too far from ` ;)
set -g base-index 1
@irfn
irfn / gist:5524539
Created May 6, 2013 11:07
gitconfig
[user]
name = Irfan Shah
email = [email protected]
[github]
user = irfn
[core]
quotepath = false
editor = mate -w
excludesfile = /Users/irfn/.gitignore_global
pager = less -+$LESS -FRX
@irfn
irfn / html bits
Created May 10, 2012 15:50
paring
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Raphaël · Punch Chart</title>
<script src="http://raphaeljs.com/raphael.js" type="text/javascript" charset="utf-8"></script>
<script src="http://raphaeljs.com/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="http://raphaeljs.com/github/dots.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="http://raphaeljs.com/demo.css" type="text/css" media="screen">
<link rel="stylesheet" href="http://raphaeljs.com/demo-print.css" type="text/css" media="print">
<style type="text/css" media="screen">
@irfn
irfn / shared_git_config
Created August 29, 2011 04:37
useful git configs
[core]
quotepath = false
editor = mate -w
[color]
branch = auto
diff = auto
interactive = auto
status = auto
[color "branch"]
current = yellow reverse
if File.file?(other)
%x{ "$TM_SUPPORT_PATH/bin/mate" "#{other}" }
#All the REST POST calls may resturn a 422..
test_pdef = Ruote.process_definition :name => 'test' do
cursor do
sequence do
participant :alpha #a user intervention that is like a confirmation
participant :beta # no user intervation required. in my case just a REST call(POST)
rewind :if => '${422_etc_in_previous_step}'
participant :gamma # no user intervation required. based on return of :beta pass arguments to :gamma
end
end
require 'rubygems'
require 'ruote'
require 'ruote/storage/fs_storage'
# preparing the engine
engine = Ruote::Engine.new(
Ruote::Worker.new(
Ruote::HashStorage.new))
Section "Files"
RgbPath "/usr/share/X11/rgb"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/misc/"
FontPath "/usr/share/fonts/Type1/"
FontPath "/usr/share/fonts/TTF/"
FontPath "/usr/share/fonts/OTF"
# FontPath "/usr/share/fonts/100dpi/"
# FontPath "/usr/share/fonts/75dpi/"