Skip to content

Instantly share code, notes, and snippets.

@Johnytran
Johnytran / RVM.md
Last active August 29, 2015 14:08 — forked from jamesfwz/RVM.md

Installing RVM

# install RVM
curl -L https://get.rvm.io | bash -s stable

# runs RVM
source /etc/profile.d/rvm.sh

# Setups required files for RVM
# .ruby-gemset
projectname
# .ruby-version
ruby-2.1.2
# Gemfile
source 'https://rubygems.org'
cd ..
@Johnytran
Johnytran / gist:1efeef7aabfc7f7adc45
Created February 9, 2015 02:38
update code from remote to local
git fetch origin
git reset --hard origin/master
@Johnytran
Johnytran / gist:5d24da73aee371d1e0d7
Created July 11, 2015 00:35
create file in command line window
echo. > Filename.txt
@Johnytran
Johnytran / gist:012ab48c1394e5b2b472
Created July 16, 2015 04:07
Install package panel for sublime text 2
import urllib2,os,hashlib; h = 'eb2297e1a458f27d836c04bb0cbaf282' + 'd0e7a3098092775ccb37ca9d6b2e4b7d'; 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()) ); by = urllib2.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), 'wb' ).write(by) if dh == h else None; print('Error validating download (got %s instead of %s), please try manual install' % (dh, h) if dh != h else 'Please restart Sublime Text to finish installation')
@Johnytran
Johnytran / gist:3c54e8ed46bb59a97230
Last active August 29, 2015 14:25
paste clipboard to vim
:put +
or
There are two simple ways to do this. Make your file in insert mode and 1) press the middle button (the scroll wheel) in your mouse, or 2) Ctrl + Shift + V
"+p Normal mode put command pastes system clipboard after cursor
@Johnytran
Johnytran / gist:a656db209bfc0adb376f
Last active August 29, 2015 14:25
copy all line in vim to vim buffer
Use:
:%y+
to yank all lines.
Explanation:
% to refer the next command to work on all the lines
y to yank those lines
@Johnytran
Johnytran / gist:cfa7aa2d1a0e49177377
Last active August 29, 2015 14:25
view directory of executable file vim
type vim
@Johnytran
Johnytran / gist:b7aa3d93c6e47d65fee9
Created July 25, 2015 11:11
Install vim run on command prompt of windows
Re-install vim:
Go to Vim Download page and click on “PC: MS-DOS and MS-Windows”. Click on the ‘gvim72.exe, which is a Self-installing executable.
To undo recent changes, use the undo command:
u : undo last change (can be repeated to undo preceding commands)
Ctrl-R : Redo changes which were undone (undo the undos). Compare to ' . ' to repeat a previous change, at the current cursor position.