Skip to content

Instantly share code, notes, and snippets.

💭
Founding Planitor

Jökull Sólberg Auðunsson jokull

💭
Founding Planitor
Block or report user

Report or block jokull

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View isholidays.py
"""
Look at the split of non-working-day windows for each year
Produces something like this:
2020 - 117 frídagar (119 í frígluggum sem hefjast á árinu)
- 1x fimm daga frí - 9.4 (Holy Thursday)
- 2x fjögurra daga frí - 24.12 (Christmas Eve), 31.12 (New Year's Eve)
- 3x þriggja daga frí - 1.5 (Labour Day), 3.5 (Whit Monday), 1.8 (Commerce Day)
- 47x tveggja daga frí
View sqla_sports.py
import os
from enum import Enum as PyEnum
from collections import namedtuple
from fastapi import Depends, FastAPI, HTTPException
from starlette.requests import Request
from starlette.templating import Jinja2Templates
from sqlalchemy import (
create_engine,
@jokull
jokull / Dockerfile
Created Mar 28, 2017
Python with texpdf binary
View Dockerfile
FROM python:2.7
MAINTAINER Solberg Audunsson <solberg@takumi.com>
# Install uWSGI
RUN pip install uwsgi pipenv
# Standard set up Nginx
ENV NGINX_VERSION 1.9.11-1~jessie
@jokull
jokull / fasteignir.py
Created Feb 20, 2017
Get notified when a new property listing on visir.is is discovered
View fasteignir.py
import os
import json
import lxml.html
from lxml.cssselect import CSSSelector
import requests
cookies = {
'session_name': 'dpoiudav0gnu6e8uf2uklift63',
}
@jokull
jokull / .env
Created May 17, 2016
Find follower accounts that have profile pics with faces in them
View .env
OAUTH_CONSUMER_KEY=
OAUTH_CONSUMER_SECRET=
OAUTH_TOKEN=
OAUTH_TOKEN_SECRET=
IMGIX_TOKEN=
View keybase.md

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 Nov 21, 2013
Bash Profile
View .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
View gist:7466602
[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
Cache a python package from PyPI on S3
View gist:5639728
#!/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
Example of an RQ exception handler that allows three failures before moving to the failed queue
View gist:5498543
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()
You can’t perform that action at this time.