Skip to content

Instantly share code, notes, and snippets.

Vishal Telangre vishaltelangre

Block or report user

Report or block vishaltelangre

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vishaltelangre
vishaltelangre / pryrc
Created Feb 1, 2013
My ~/.pryrc config at office
View pryrc
# === EDITOR ===
Pry.editor = 'subl'
# == Pry-Nav - Using pry as a debugger ==
Pry.commands.alias_command 'c', 'continue' rescue nil
Pry.commands.alias_command 's', 'step' rescue nil
Pry.commands.alias_command 'n', 'next' rescue nil
# === CUSTOM PROMPT ===
# This prompt shows the ruby version (useful for RVM)
@vishaltelangre
vishaltelangre / aprc
Created Feb 1, 2013
My ~/.aprc (awesome_print) file at office
View aprc
AwesomePrint.defaults = {
:indent => 2,
:sort_keys => true,
:color => {
:args => :greenish,
:array => :pale,
:bigdecimal => :blue,
:class => :yellow,
:date => :greenish,
:falseclass => :red,
View pry_usage_commands
load rails console w/ pry
========================
pry -r ./config/environment
help
cd Article
self
@vishaltelangre
vishaltelangre / ST2_packages
Created Feb 1, 2013
Packages I use with Sublime Text 2 editor (at office)
View ST2_packages
ActionScript, Alignment, All Autocomplete, Alternative Autocompletion, AppleScript, ASP, Autocomplete Javascript with Method Signature, Auto Encoding for Ruby, AutoFileName, Backbone.js, Batch File, BeautifyRuby, Bracketeer, BracketHighlighter, BufferScroll, C#, C++, ChangeQuotes, Clojure, CoffeeCompile, CoffeeScript, CoffeeScript Function Finder, Color Highlighter, ColorPick, ColorPicker, Color Scheme - Default, ColorSchemeSelector, Console API Snippets (JavaScript), copy-file-name, CSS, CSScomb, CSSFormat, CSS Less(ish), Csslisible, CSS Media Query Snippets, CSS Snippets, CSSTidy, CTags, Current Scope, D, Dayle Rees Color Schemes, Default, DetectSyntax, Diff, ERB Insert and Toggle Commands, ERB Snippets, Erlang, Folder List, Function Name Display, Git, GitGutter, Git Status Files, Go, Goto Folder, GotoTab, Graphviz, Groovy, Hacker News, Haml, Haskell, HighlightDuplicates, HTML, HTML2Haml, HTML5, HTMLAttributes, HTML Snippets, HtmlTidy, InsertDate, Java, JavaScript, JavaScriptNext - ES6 Syntax, JavaScript Sn
@vishaltelangre
vishaltelangre / ST2_default_settings
Last active Dec 12, 2015
Sublime Text 2 Preferences - Sublime settings
View ST2_default_settings
// While you can edit this file, it's best to put your changes in
// "User/Preferences.sublime-settings", which overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overriden in the platform
@vishaltelangre
vishaltelangre / rails_installation_on_ubuntu.sh
Last active Dec 13, 2015
Installs Ruby on Rails on Ubuntu (for lazy people like me) + Zsh (w/ oh-my-zsh) + Sublime Text 2
View rails_installation_on_ubuntu.sh
sudo apt-get update &&
sudo apt-get install build-essential git-core curl zsh &&
sudo chsh -s /bin/zsh &&
curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh &&
curl -L get.rvm.io | bash -s stable &&
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' | \
tee -a ~/.zshrc ~/.bashrc &&
. ~/.zshrc && . ~/.bashrc &&
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev fortune \
curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 \
@vishaltelangre
vishaltelangre / html5_history_fun.js
Created Feb 14, 2013
Some fun w/ HTML5's history API
View html5_history_fun.js
var original_url = window.location.href
var to_be_changed_url = "blah blah url"
history.pushState(null, null, '/foo.html');
window.onpopstate = function(e){
if(e.state){
history.pushState(null, null, original_url);
}
//window.location.href = to_be_changed_url;
};
document.onkeydown = function() {
@vishaltelangre
vishaltelangre / auto_install_sublime_packages.markdown
Last active Jul 10, 2019
[Automate Packages Installation in Sublime Text 2] -- Automatically install Sublime Text 2 packages (some necessary ones, w/o fucking crap ones which makes sublime alike hell!)
View auto_install_sublime_packages.markdown
  • To install packages, every time pressing ' ctrl+shift+pPackage Control: Install Package is very cumbersome task... right?

  • After fresh installation of ST2, open it and ctrl+` and hit enter after pasting below line [(1)][1]:

  import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
  • Restart ST2.

  • Open terminal, and navigate to Sublime's dir under your home folder by below command and create file w/ name Package Control.sublime-settings there in:

View README.md

Deploying Rails to Linode

Installing Ruby Enterprise Edition, Apache, MySQL, and Passenger for deploying Rails 3.0 applications.

Get a Linode, and set it up with Ubuntu 10.04 LTS so that you have till April 2013 to get updates. Once the Linode is formatted, boot it and continue on.

Set up an 'A' record in your DNS, pointing to the IP of your Linode. I'm using demo.napcs.com here.

Initial setup

View gist:5125262

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA
You can’t perform that action at this time.