Skip to content

Instantly share code, notes, and snippets.

View erikcox's full-sized avatar

Erik erikcox

View GitHub Profile
@erikcox
erikcox / SublimeText2.txt
Created August 2, 2013 03:35
Sublime Text notes
Ctrl+D to select next occurence of word.
Alt+F3 to select all occurences of a word.
R-Click & Shift for column select. Ctrl to add to selection.
Make selection, Ctrl+Shift+L (L for lines)
Ctrl+Shift+P for command bar. Type somethign like syntax or just javascript (it does fuzy searching)
Ctrl+P searches your file system (fuzzy search as well). Enter @ symbol on highlighted file to get Ctrl+R functionality (see)
Ctrl+R to browse symbols / method names / style sheets.
Ctrl+I is incremental search (what does this do?)
Ctrl+Shift+P and type snipper for the working files language snippets
You can create your own snippets.
@erikcox
erikcox / update_pip_modules_windows.py
Last active August 29, 2015 14:04
Update Python modules with pip (Windows)
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)
@erikcox
erikcox / update_pip_modules.py
Created August 1, 2014 15:56
Update Python modules with pip (*nix/OS X)
#!/usr/bin/env python
import os
import pip
dists = []
for dist in pip.get_installed_distributions():
dists.append(dist.project_name)
for dist_name in sorted(dists, key=lambda s: s.lower()):
@erikcox
erikcox / permissions.txt
Created August 1, 2014 15:56
Web server permissions
Permissions
Directories/Files Permissions
Public directories 0711
Private Directories 0700
Python scripts (.py) 0700
CGI scripts (.py) 0755
Regular files inside pub dirs (CSS, HTML, etc) 0644
@erikcox
erikcox / layout-debug.css
Created August 1, 2014 15:57
CSS layout debug class
.debug { border:1px dashed red; }
@erikcox
erikcox / tmux.txt
Last active February 17, 2016 19:00
tmux notes
tmux new -s session_name -n window_name # Creates a new session with a named window
tmux attach -t session_name # Attaches to tmux session
tmux ls # Lists all tmux sessions
#PREFIX is Ctrl-b by default
PREFIX ? # Lists all commands available
PREFIX d # Detaches window
PREFIX c # New window
PREFIX , # Rename window
PREFIX n # Next window
@erikcox
erikcox / git.txt
Last active August 29, 2015 14:05
Git notes
# Setup
git config --global user.name "Erik Cox"
git config --global user.email "erikbcox@gmail.com"
git config --global color.ui auto
# Creating a new local repository
git init
# Cloning
git clone <URL>
@erikcox
erikcox / virtualenvwrapper.py
Created August 19, 2014 02:54
pip, virtualenv & virtualenvwrapper
mkvirtualenv [ENV_NAME] # creates and activates a fresh virtual environment
rmvirtualenv [ENV_NAME] # removes virtual environment
workon [ENV_NAME] # activates an already-created virtual environment
deactivate # deactivates the virtual environment that is currently active
# within an activated virtualenv
pip install [PACKAGE_NAME] #installs a package into the virtualenv
pip freeze # lists the packages that is installed & accessible within the virtualenv
@erikcox
erikcox / android_sdk_update.sh
Last active October 14, 2015 17:37
Android Notes
android update sdk --no-ui --all
function fizzBuzz(n) {
for (i = 0; i <= n; i++) {
if (i % 15 === 0) {
console.log("FizzBuzz");
} else if (i % 3 === 0) {
console.log("Fizz");
} else if (i % 5 === 0) {
console.log("Buzz");
} else {
console.log(i);