Skip to content

Instantly share code, notes, and snippets.

# Tweak the existing Logging integration to work with Logbook.
# Mostly copy-paste from https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/logging.py
class SentryHandler(logbook.Handler):
def emit(self, record):
with capture_internal_exceptions():
self.format(record)
return self._emit(record)
def _emit(self, record):
hub = Hub.current
@nip3o
nip3o / aws-route53-dyndns.py
Last active July 10, 2017 20:38
Yet another DynDNS script for AWS Route53
#!/usr/bin/python
import re
import boto3
import requests
ZONE_ID = 'ABCDEFGH123545'
DOMAIN_NAME = 'whatever.com'
new_ip = re.sub('[\s+]', '', requests.get('http://checkip.amazonaws.com').text)
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQ4bSdlDsom9srpCVx/JJ8DcbTBeMWOet5Ko49gbWMkKKTislWfJVgfBD1fUmzjgo1WHeI1oKImEmHIRjmwxU9LH1TdYzad1P3QLALXeKjIOVwGJIKCJQJKQvLrUNXk8IzebzDJNcf/LjtAf0fx6qs65Qo6TxKgiKcgZ0szxUKZYH/Etz2tDCO33kyhY9Azyd9NSG/kece8FHp6a9wK7nenB5u8B8F/gw1WsWdILdYV+m/Jk2KIG9ogJLvJzIQAKNh2f+KBZp0GDzigIMQdazGm0cwEXxqIh7luAOkUuvpPq8EdywHmn4yt+4unvKVCyEtlOs/dasq2+wUqM6DTlz/ niclas@fox.niclasolofsson.se
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.11764705926179886</real>
$('element').daterangepicker({
locale: {
format: 'YYYY-MM-DD',
separator: ' - ',
applyLabel: 'Ok',
cancelLabel: 'Avbryt',
fromLabel: 'Från',
toLabel: 'Till',
customRangeLabel: 'Annan',
weekLabel: 'v.',
@nip3o
nip3o / highcharts.lang.se.js
Created November 11, 2015 13:42
Highcharts and Highstock Swedish translations
Highcharts.setOptions({
lang: {
contextButtonTitle: 'Diagram-meny',
decimalPoint: ',',
downloadJPEG: 'Ladda ned JPEG-bild',
downloadPDF: 'Ladda ned PDF-dokument',
downloadPNG: 'Ladda ned PNG-bild',
downloadSVG: 'Ladda ned SVG-vektorgrafik',
drillUpText: 'Tillbaka till {series.name}',
invalidDate: '',
@nip3o
nip3o / counter.py
Last active August 29, 2015 14:20
PelmeCommitCounter
from github import Github
from collections import defaultdict
from datetime import datetime
g = Github('...', '...')
SCRIPT = 'SCRIPT'
HKC = 'HKC'
OTHER = 'OTHER'
@nip3o
nip3o / gist:4976fb17facdbdc76e3d
Last active August 29, 2015 14:13
keybase.md

Keybase proof

I hereby claim:

  • I am nip3o on github.
  • I am nip3o (https://keybase.io/nip3o) on keybase.
  • I have a public key whose fingerprint is C911 714C 4C12 7333 9539 8C4E 9517 53EE E335 6BDB

To claim this, I am signing this object:

@nip3o
nip3o / Molokai.itermcolors
Created December 21, 2014 21:24
iTerm color themes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.11764705926179886</real>
<key>Green Component</key>
<real>0.11372549086809158</real>