Skip to content

Instantly share code, notes, and snippets.

View jokull's full-sized avatar
☺️

Jökull Sólberg Auðunsson jokull

☺️
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jokull on github.
  • I am jokull (https://keybase.io/jokull) on keybase.
  • I have a public key whose fingerprint is 433B F05A 668A 1878 2A74 FAC7 32EE 39EB 0247 7299

To claim this, I am signing this object:

@jokull
jokull / .profile
Created November 21, 2013 13:55
Bash Profile
PATH=/usr/local/bin:/usr/local/sbin:$PATH
PATH=/usr/local/share/npm/bin:$PATH
PATH=/usr/local/heroku/bin:$PATH
export HISTSIZE=1000
source /usr/local/Cellar/autoenv/0.1.0/activate.sh
source /usr/local/etc/bash_completion.d/git-completion.bash
export LC_CTYPE=is_IS.UTF-8
@jokull
jokull / gist:7466602
Created November 14, 2013 13:16
My .gitconfig
[user]
name = Jökull Sólberg Auðunsson
email = jokull@solberg.is
[core]
excludesfile = ~/.gitignore
editor = subl -n -w
[difftool]
prompt = false
[diff]
tool = Kaleidoscope
@jokull
jokull / gist:5639728
Created May 23, 2013 21:51
Cache a python package from PyPI on S3
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""pycache -- cache a python package from PyPI on S3.
A simple script to collect a cache of packages locally and sync them up to an S3 bucket, using directories as namespaces so that different projects can have different dependencies.
This is just about the simplest thing that could possibly work.
"""
import warnings
warnings.filterwarnings('ignore')
@jokull
jokull / gist:5498543
Created May 1, 2013 21:30
Example of an RQ exception handler that allows three failures before moving to the failed queue
queues = []
def retry_handler(job, exc_type, exc_value, traceback):
# Returning True moves the job to the failed queue (or continue to
# the next handler)
job.meta.setdefault('failures', 1)
job.meta['failures'] += 1
if job.meta['failures'] > 3 or isinstance(exc_type, (LookupError, CorruptImageError)):
job.save()
@jokull
jokull / Preferences.sublime-settings
Last active December 14, 2015 21:28
Sublime Text 2 settings for Python development with nice linting colors
{
"auto_complete": false,
"close_windows_when_empty": false,
"color_scheme": "Packages/User/Tomorrow-Night.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"find_selected_text": true,
"fold_buttons": false,
"folder_exclude_patterns":
[
@jokull
jokull / .osx.sh
Created March 12, 2013 13:52
My Mountain Lion settings
# Disable opening and closing window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
# Increase window resize speed for Cocoa applications
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Save to disk (not to iCloud) by default
@jokull
jokull / s3_sync.py
Created November 22, 2012 15:36
S3 static assets sync that is awesome
# encoding=utf-8
import sys
import datetime
import email
import mimetypes
import os
import time
import gzip
import subprocess
@jokull
jokull / context_processors.py
Created November 22, 2012 11:45
Much better URL reversal in Django
# encoding=utf-8
from django.core.urlresolvers import reverse
def burl_context(request):
def burl(name, *args, **kwargs):
external = kwargs.pop('_external')
path = reverse(name, args=args, kwargs=kwargs)
@jokull
jokull / gist:3303572
Created August 9, 2012 11:52
PVG Graphite Server Configuration

Users

graphite is the user that runs all graphite related services.

Graphite

Web Interface

NGiNX listens on TCP port 80