Skip to content

Instantly share code, notes, and snippets.

View kenbolton's full-sized avatar

Ken Bolton kenbolton

  • BScientific
  • Beacon, NY
View GitHub Profile
@kenbolton
kenbolton / amphetamine.md
Created June 11, 2019 15:56 — forked from heptal/amphetamine.md
Hammerspoon replacement for Caffeine

Amphetamine

Simple toggleable menubar replacement for Caffeine in Hammerspoon, utilizing ASCIImage (for vector) to create the amphetamine icons. Motivated by the official Caffeine app's icon looking bad on Retina

Get latest version here: amphetamine.lua

Save as amphetamine.lua in ~/.hammerspoon/ and put amphetamine = require "amphetamine" in your init.lua

@kenbolton
kenbolton / spacemacs-cheshe.org
Last active April 5, 2018 15:26 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • `SPC q q` - quit
  • `SPC w /` - split window vertically
  • `SPC w` - - split window horizontally
  • `SPC 1` - switch to window 1
  • `SPC 2` - switch to window 2
  • `SPC w c` - delete current window
  • `SPC TAB` - switch to previous buffer
  • `SPC b b` - switch buffers
@kenbolton
kenbolton / kv_bencher.py
Last active December 14, 2015 17:29 — forked from mikeyk/gist:1329319
Python script to test Redis set/get, hashed sets, memcached, and PostgreSQL hstore for memory consumption.
#! /usr/bin/env python
import redis
import random
import pylibmc
import psycopg2
import sys
from time import clock
r = redis.Redis(host='localhost', port=6379)
@kenbolton
kenbolton / gist:3953717
Created October 25, 2012 16:10 — forked from joshcartme/gist:3943826
cartridge order setup which adds in tax total
from decimal import Decimal
from cartridge.shop.models import Order, SelectedProduct
def setup(self, request):
"""
Set order fields that are stored in the session, item_total, tax_total,
and total based on the given cart, and copy the cart items to the order.
Called in the final step of the checkout process prior to the payment
@kenbolton
kenbolton / gist:1436612
Created December 6, 2011 03:42 — forked from alokmishra/gist:835276
deploy with gunicorn django fabric git
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._