Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lepht on github.
  • I am petec (https://keybase.io/petec) on keybase.
  • I have a public key whose fingerprint is C7B7 846B E6D4 E0E6 C606 801D D27F 4A79 7675 81EB

To claim this, I am signing this object:

@lepht
lepht / GistList!.md
Created September 19, 2014 21:31
Try GistList for iOS! http://gistlist.io/

##alt text GistList: TODO for coders alt text

@lepht
lepht / .vimrc.indent
Created May 13, 2014 15:45
vim indent settings
filetype on
filetype plugin indent on
set autoindent
set copyindent
# original from @ttscoff http://brettterpstra.com/2014/05/11/making-my-tmux-life-easier/
# print a banner for the current window name within tmux
tm-win-banner() {
local winname sessionname
if [[ -n $TMUX ]]; then
sessionname=`tmux list-panes -F "#S"`
winname=`tmux display-message -p '#{window_name}'`
figlet -w `tput cols` -f graffiti "$sessionname:$winname"
fi
@lepht
lepht / vim-scp
Last active December 27, 2015 19:29
vim-scp Uses scp to copy a local version of the remote file over scp, edit it with vim, and with each save connect via scp and save it to the remote location. Original source: [Fast remote editing with Vim - Erik Zaadi](http://www.erikzaadi.com/2013/03/07/fast-remote-editing-with-vim/)
#!/bin/sh
# The vim binary you would like to use
# eg `mvim -f` will run macvim
VIM_BIN="mvim -f"
echo "vim-scp FTW"
if [ $# -ne 2 ]; then
echo "usage : `basename $0` user@host /path"
exit 1
@lepht
lepht / unicode_pain.txt
Created October 1, 2013 07:20
Unicode string that crashes OS X 10.8 and iOS 6
سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the present tense: "Fix bug" and not "Fixed
@lepht
lepht / git_diff_commit_alias.sh
Created August 16, 2013 20:25
adds an alias for `git diffc [refspec]` that will show the changes made by a particular commit.
git config alias.diffc "log -u -1"
@lepht
lepht / gmail-notify.rb
Created June 27, 2013 14:27 — forked from danchoi/barebones gmail notifier
Barebones gmail notifier
require 'rubygems'
require 'net/imap'
require 'tmail'
require 'parsedate'
# NOTE: Set these values before you run the script
# Your gmail username
USERNAME = "YOUR_USERNAME"
# Your gmail password
@lepht
lepht / args.pl
Last active December 11, 2015 13:58
Perl named, self-documenting subroutine arguments with default values
# Perl named, self-documenting subroutine arguments with default values
sub foo {
my %args = (
# Set your defaults/doc your accepted args here
arg1 => 'default'
arg2 => undef,
somelist => [qw( some stuff )],
@_ # Passed-in args replace your defaults