Skip to content

Instantly share code, notes, and snippets.

View numberwhun's full-sized avatar

Jefferson Kirkland numberwhun

View GitHub Profile
@numberwhun
numberwhun / tidying_up
Created November 3, 2015 19:35
The Japanese Art of Decluttering and Organizing
The Life-Changing Magic of Tidying Up
The Japanese Art of Decluttering and Organizing
By Marie Kondo
Visualize your ideal life and ideal living space, then you are in a position to start tidying your space and move closer to your ideal life.
A tidy environment is a place where you can access things you truly need and truly love. Do not keep things you do not like so you can do something with them later.
The goal of tidying your home is to create a space to improve your body and your mind.
@numberwhun
numberwhun / get_mac_past_white_screen
Created November 7, 2015 17:26
Get Mac past white screen
From: http://appletoolbox.com/2014/09/mac-fix-white-screen/
My Mac won’t start: How to fix white screen
Recently I had this problem. My Mac would turn on but it would get stuck on the white screen upon startup after chime. This means that OS X can’t start because of problems with the system’s hardware or software. If your Mac fails to start up normally, there are a few things that you mat try to troubleshoot. First of all, there could be many issues, so fixes described here may not fix your problem. If you are having this problem, try steps below until your issue is resolved.
1.Try a Safe Boot
Mac OS X 10.2 and later Safe Boot includes disk checking and repair. First start your Mac in Safe Mode. To do this, shut down your Mac. Now Turn on your computer by pressing the power key while holding down the Shift key. When you see the Apple logo, release the Shift key. After your Mac fully starts, restart your computer normally without holding any keys/buttons during startup. Note that Safe Boot is slower to b
@numberwhun
numberwhun / conda_cheat
Created November 22, 2015 03:18 — forked from qheuristics/conda_cheat
conda cheatsheet
to create a new environment
conda create -n mynewenviron package1 package2 etc
conda create -n newenv --clone ~anaconda
to remove an environment
conda remove -n myenvirontoremove --all
always start with
@numberwhun
numberwhun / Guitar Links
Created December 4, 2015 17:38
Guitar LInks
@numberwhun
numberwhun / beautiful_idiomatic_python.md
Created December 8, 2015 19:33 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@numberwhun
numberwhun / A script to remove a ssh public key from a remote host
Created December 8, 2015 21:50
A script to remove a ssh public key from a remote host
#!/bin/bash
#
# A script to remove a ssh public key from a remote host
#
# Author: Andrea Scarpino <me@andreascarpino.it>
function main()
{
DEFAULT_PORT="22"
DEFAULT_PUBKEY="$HOME/.ssh/id_rsa.pub"
@numberwhun
numberwhun / vimrc configuration
Created February 20, 2013 10:05
Some of my typical vimrc settings.
set history=5000 " lines of command history
set noautoindent " no text indenting
set nosmartindent " as above
set nocindent " as above
set tabstop=4 " number of spaces in a tab
set ttyfast " smoother changes
syntax on " syntax highlighting
colorscheme evening " set color scheme to what I like
set number " show line numbers
set ignorecase " ignore case when searching
@numberwhun
numberwhun / Base64 Decode A File
Created February 22, 2013 09:31
A quick, one-liner to decode a base64 encoded file
/path/to/openssl base64 -d -in <base64_encoded_file> -out <new_filename>
@numberwhun
numberwhun / Module Import Code
Created June 28, 2013 18:41
Code for importing a module other than something in the standard library. Anything in < > needs to be replaced (including removing the < >).
try:
import <module>
except ImportError:
print '<module> module required. Please install with "pip install <module>"'
@numberwhun
numberwhun / which.py
Created July 2, 2013 21:36
'which' command re-write in Python to allow you to find an executable, if it exists in the current $PATH. This script is specific to *nix machines as it does not use the PATHEXT, which would be needed on a Windows based machine.
#!/usr/bin/env python
import os
import os.path
def which(filename):
"""This is specifically for *nix based machined. It will find the path to the app you specify, if it exists"""
paths = os.environ.get("PATH").split(os.pathsep)
candidates = []
for location in paths: