Skip to content

Instantly share code, notes, and snippets.

View linkleonard's full-sized avatar

Leonard Law linkleonard

View GitHub Profile
@linkleonard
linkleonard / readme.md
Created March 25, 2016 15:20
Preparing Gnome Terminal for oh-my-zsh themes on Ubuntu

Install powerline fonts

https://github.com/powerline/fonts

Gnome Terminal configuration

Set font to one of the fonts in Powerline i.e. Droid Sans Mono Slashed for Powerline

Probably set the color palette. Linux console works well.

@linkleonard
linkleonard / script.bash
Created March 22, 2016 22:18
GNU find cheatsheet
#!/bin/bash
# Find all files ending in "*.py", but exclude the ./venv directory
find . -path ./venv -prune -o -name '*.py' -print
@linkleonard
linkleonard / atom-update.sh
Created March 3, 2016 20:55
Atom update script
#!/bin/bash
# Based on http://askubuntu.com/a/630530
wget -q https://github.com/atom/atom/releases/latest -O /tmp/latest
wget -q https://github.com$(grep -E 'href=".*atom-amd64.deb' /tmp/latest --only | sed -e 's/href="//') -O /tmp/atom-amd64.deb
sudo dpkg -i /tmp/atom-amd64.deb
@linkleonard
linkleonard / expand.sh
Created November 5, 2015 21:42
Expand tabs to 4 spaces in all *.html, *.css, *.js files in the current directory tree.
find -E . -regex ".*\.(html|css|js) ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
@linkleonard
linkleonard / .profile
Created October 29, 2015 16:26
Custom OSX .profile
# Custom OSX .profile
# Set default editor to emacs
export EDITOR=emacs
# Specify a custom prompt. This is linux mint-ish.
export PS1="\[\]\u@\h\[\]:\[\]\w\[\]$\[\] "
@linkleonard
linkleonard / add-sublime-to-context-menu-windows.bat
Created October 29, 2015 01:19
Script to add a context menu entry for Sublime text on Windows.
:: Add a context menu entry for "quick editing" files from Windows Explorer.
:: Original work: http://wordpress-corner.com/add-open-sublime-text-3-windows-explorer-context-menu/
:: Usage instructions:
:: 1. Make sure sublime text is installed.
:: 2. Edit this file so that set2Path points to the location of the
:: Sublime text executable.
:: 3. Run this file as an Administrator.
@sloria
sloria / bobp-python.md
Last active September 9, 2025 10:52
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens