Skip to content

Instantly share code, notes, and snippets.

Avatar

Niclas Olofsson nip3o

View GitHub Profile
View sentry_logbook_handler.py
# 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 Jul 10, 2017
Yet another DynDNS script for AWS Route53
View aws-route53-dyndns.py
#!/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)
View niclas@fox.niclasolofsson.se
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQ4bSdlDsom9srpCVx/JJ8DcbTBeMWOet5Ko49gbWMkKKTislWfJVgfBD1fUmzjgo1WHeI1oKImEmHIRjmwxU9LH1TdYzad1P3QLALXeKjIOVwGJIKCJQJKQvLrUNXk8IzebzDJNcf/LjtAf0fx6qs65Qo6TxKgiKcgZ0szxUKZYH/Etz2tDCO33kyhY9Azyd9NSG/kece8FHp6a9wK7nenB5u8B8F/gw1WsWdILdYV+m/Jk2KIG9ogJLvJzIQAKNh2f+KBZp0GDzigIMQdazGm0cwEXxqIh7luAOkUuvpPq8EdywHmn4yt+4unvKVCyEtlOs/dasq2+wUqM6DTlz/ niclas@fox.niclasolofsson.se
View monokai.itermcolors
<?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>
View daterangepicker.sv.js
$('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 Nov 11, 2015
Highcharts and Highstock Swedish translations
View highcharts.lang.se.js
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 Aug 29, 2015
PelmeCommitCounter
View counter.py
from github import Github
from collections import defaultdict
from datetime import datetime
g = Github('...', '...')
SCRIPT = 'SCRIPT'
HKC = 'HKC'
OTHER = 'OTHER'
View gist:4976fb17facdbdc76e3d

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:

View Molokai.itermcolors
<?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>