Skip to content

Instantly share code, notes, and snippets.

View kxhitiz's full-sized avatar
:octocat:
{ hello: world }

Kshitiz Gurung kxhitiz

:octocat:
{ hello: world }
View GitHub Profile
PS1="\W $ "
export PATH="/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:$PATH"
export JAVA_HOME='/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home'
export EDITOR='mate -w'
# my aliases
alias ll='ls -la'
alias e='mate . &'
alias ebash='mate ~/.bash_login &'
@kxhitiz
kxhitiz / gist:1022286
Created June 13, 2011 03:33
my account and user model overview
Account Model(account.rb):
class Account < ActiveRecord::Base
has_many :projects, :dependent => :destroy
has_many :users, :dependent => :destroy
accepts_nested_attributes_for :users, :reject_if => :all_blank, :allow_destroy => true
validates :subdomain, :presence => true, :uniqueness => true
validates_exclusion_of :subdomain,
# ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# Assembly Line: video-transcription
# ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁ ☁
# See docs at http://developers.cloudfactory.com/lines/yaml.html
# See examples at http://developers.cloudfactory.com/lines/examples.html
# Fill in your API key below! (See http://developers.cloudfactory.com/account#settings)
api_key: 5f27b0c87532ff8389fd4955b88b6336c579b529 #0cff92505889e9530baebda027459e1ce073e9dd
title: initial_split_media
description: A sample line generated via CLI to use both standard and custom form for video transcription.
department: Data Processing # Digitization, Web Research, etc
@kxhitiz
kxhitiz / git_io
Created November 17, 2011 04:59
git.io implementation failed
HTTP/1.0 417 Expectation failed
Server: squid/2.7.STABLE9
Date: Thu, 17 Nov 2011 04:57:11 GMT
Content-Type: text/html
Content-Length: 1445
X-Squid-Error: ERR_INVALID_REQ 0
X-Cache: MISS from localhost
X-Cache-Lookup: NONE from localhost:3128
Via: 1.0 localhost:3128 (squid/2.7.STABLE9)
Connection: close
@kxhitiz
kxhitiz / launch_sublime_from_terminal.markdown
Created June 5, 2012 04:10 — forked from artero/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@kxhitiz
kxhitiz / k_gist.rb
Created June 25, 2012 05:20
random gist
#This is just a test gist upload using rubygem from command line
@kxhitiz
kxhitiz / responsive-iframes.css
Created June 28, 2012 05:09 — forked from aarongustafson/responsive-iframes.css
Responsive iFrames with jQuery
iframe {
max-width: 100%;
}
@kxhitiz
kxhitiz / gist:3023155
Created June 30, 2012 09:45
installing alien
sudo apt-get install alien dpkg-dev debhelper build-essential
sudo alien packagename.rpm
@kxhitiz
kxhitiz / gist:3033909
Created July 2, 2012 15:50
Mongodb starting problem in ubuntu
You started mongodb server, but No matter what. However, when you run sudo status mongodb again, you’ll get
mongodb stop/waiting instead of mongodb start/running
Note: This condition is largely due to an unclean shutdown, and results in the creation of a lockfile /var/lib/mongodb/mongod.lock.
The fix is a quick two-step process as follows:
Remove the lockfile.
Run the repair script.
This is accomplished as follows:
@kxhitiz
kxhitiz / gist:3142947
Created July 19, 2012 10:40
Mongoid Logger in Console
Mongoid.logger = Logger.new($stdout)