Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am carlkibler on github.
  • I am ckibler (https://keybase.io/ckibler) on keybase.
  • I have a public key whose fingerprint is 2B82 FBE8 A5E9 D5A1 558F C574 F438 D251 3078 3EA1

To claim this, I am signing this object:

@carlkibler
carlkibler / standard.sh
Created August 16, 2018 16:45 — forked from hfossli/standard.sh
Standard bash script format
#!/bin/bash
CLEAR='\033[0m'
RED='\033[0;31m'
function usage() {
if [ -n "$1" ]; then
echo -e "${RED}👉 $1${CLEAR}\n";
fi
echo "Usage: $0 [-n number-of-people] [-s section-id] [-c cache-file]"
@carlkibler
carlkibler / setup.md
Created May 1, 2018 20:02 — forked from brosner/setup.md
My development environment setup

Prepare by switching out of bash from Homebrew:

chsh -s /bin/bash

To clean my system and reinstall Homebrew:

rm -rf ~/.local && mkdir ~/.local
rm -rf ~/Library/Caches/pip
rm -rf ~/.pyenv

rm -rf ~/.config/yarn

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

  • Update HISTORY.rst
  • $ bumpversion minor
  • Install the package again for local development, but with the new version number:
$ mkvirtualenv runtests
$ python setup.py develop
$ cookiecutter --version
  • Run the tests:
@carlkibler
carlkibler / allow_ips.py
Created August 13, 2013 21:30
Useful code for Django Debug Toolbar. it turns the INTERNAL_IPS list into a list of pattern matches. Wildcards are allowed for whatever specificity you want. Cleanedup form original inspiration: http://dancarroll.org/blog/2011/01/debugging-django-dev-server/
# Insert this into settings.py, or move and adapt to wherever you need.
if DEBUG:
from fnmatch import fnmatch
class pattern_list(list):
def __contains__(self, key):
for pattern in self:
if fnmatch(key, pattern): return True
return False
INTERNAL_IPS = pattern_list(['127.0.0.1', '192.168.*.*'])
@carlkibler
carlkibler / perfect_ajax.js
Created February 10, 2013 16:14
A nearly ideal Ajax request pattern using JQuery.
/* The "Perfect AJAX Request", credit to Kyle Schaeffer
http://kyleschaeffer.com/development/the-perfect-jquery-ajax-request/
*/
$.ajax({
type: 'POST',
url: 'http://kyleschaeffer.com/feed/',
data: { postVar1: 'theValue1', postVar2: 'theValue2' },
beforeSend:function(){
// this is where we append a loading image
$('#ajax-panel').html('<div class="loading"><img src="/images/loading.gif" alt="Loading..." /></div>');
sudo apt-get -qq update && sudo apt-get -qq upgrade && sudo apt-get -qq install curl && echo &&
bash -c "$(curl -fsSL https://raw.github.com/carschar/dotfiles/master/bin/dotfiles)" && source ~/.bashrc
@carlkibler
carlkibler / ubuntu_setup.sh
Last active September 26, 2015 18:28
basic ubuntu setup
# install some useful basics
sudo apt-get -y install git git-gui git-doc git-cvs git-svn
sudo apt-get -y install subversion cvs vim tmux openssh-server curl
sudo apt-get -y install htop dos2unix
sudo apt-get -y install build-essential libssl-dev
# install python packages
sudo apt-get -y install python-2.7 python-setuptools python-dev build-essential
curl -O https://github.com/pypa/pip/raw/master/contrib/get-pip.py && sudo python get-pip.py
sudo pip install --upgrade pip
@carlkibler
carlkibler / oracle11xe_deploy.sh
Created July 20, 2011 20:17
Oracle 11 XE Installer for Ubuntu
#!/bin/bash
# Oracle 11 Express (XE) Installer for Ubuntu
# by Carl Scharenberg, July 18, 2011, carl.scharenberg@gmail.com
# Original blog post: http://blog.uncommonguy.com/?p=1234
#
# Use as you like, but please leave original credits in place.
# Disclaimer: Use at your own risk. Don't ever blindly run scripts without
# knowing what they do, including this one.
# Assumption: you have downloaded the Oracle 11 Express debian package from