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
@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 / 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 / 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 / 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:7466602
Created November 14, 2013 13:16
My .gitconfig
[user]
name = Jökull Sólberg Auðunsson
email = [email protected]
[core]
excludesfile = ~/.gitignore
editor = subl -n -w
[difftool]
prompt = false
[diff]
tool = Kaleidoscope
@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

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 / .env
Created May 17, 2016 08:14
Find follower accounts that have profile pics with faces in them
OAUTH_CONSUMER_KEY=
OAUTH_CONSUMER_SECRET=
OAUTH_TOKEN=
OAUTH_TOKEN_SECRET=
IMGIX_TOKEN=
@jokull
jokull / fasteignir.py
Created February 20, 2017 09:24
Get notified when a new property listing on visir.is is discovered
import os
import json
import lxml.html
from lxml.cssselect import CSSSelector
import requests
cookies = {
'session_name': 'dpoiudav0gnu6e8uf2uklift63',
}
@jokull
jokull / Dockerfile
Created March 28, 2017 10:33
Python with texpdf binary
FROM python:2.7
MAINTAINER Solberg Audunsson <[email protected]>
# Install uWSGI
RUN pip install uwsgi pipenv
# Standard set up Nginx
ENV NGINX_VERSION 1.9.11-1~jessie