Skip to content

Instantly share code, notes, and snippets.

@lukas-hetzenecker
lukas-hetzenecker / change_pk_values_in_laoddata_json.py
Last active August 28, 2015 01:56
django: change primary key - export data using django admin dumpdata, edit json file and load data again
import json
data = json.load(open('data.json'))
# get changed fields
# import model
model = User
changes = [(unicode(x.related_model._meta), x.field.name) for x in User._meta.get_all_related_objects()] # replace User with your model
m = {}
#!/home/lukas/projects/virtualenv-photostation/bin/python
import os
import sys
import argparse
from libxmp import consts, XMPFiles, XMPError
from difflib import unified_diff
parser = argparse.ArgumentParser(description='Resync image tags.')
parser.add_argument('folders', metavar='FOLDER', type=str, nargs='*',
@lukas-hetzenecker
lukas-hetzenecker / create_links.py
Created October 13, 2016 01:53
Export marked photos to Synology PhotoStation
>>> for x in filter(lambda x: 'unknown' in x, [x['name'] for x in list(client.query("SHOW MEASUREMENTS"))[0]]):
... print("DROP MEASUREMENT \"" + x + "\"")
>>> for x in filter(lambda x: 'unknown' in x, [x['name'] for x in list(client.query("SHOW MEASUREMENTS"))[0]]):
... client.query("DROP MEASUREMENT \"" + x + "\"")
from influxdb import InfluxDBClient
# weatherservice.py
import asyncio
import aiohttp
from PyQt5.QtCore import pyqtProperty, pyqtSignal, QObject
base_url = 'http://api.openweathermap.org/data/2.5/'
HEADERS = {
'user-agent': ('smart-mirror lukas@hetzenecker.me'),
044bf0e7a3591a799a06ebd53be599deec85b48ddc99b7784e6cd13d4308744ab08ab1b207febec26664ef078f4f1182d47bcfe247905dd302341ea26ff92e133c
{
"name": "GethTranslation",
"engine": {
"Ethash": {
"params": {
"minimumDifficulty": "0x20000",
"difficultyBoundDivisor": "0x800",
"durationLimit": "0xd",
"blockReward": "0x4563918244F40000",
"registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2",
#!/usr/bin/env python
import binascii
import zmq
import struct
import csv
import time
from iota import Address, ProposedTransaction, Tag, Transaction
port = 5556

Keybase proof

I hereby claim:

  • I am lukas-hetzenecker on github.
  • I am luhe (https://keybase.io/luhe) on keybase.
  • I have a public key ASBfiGUD9OYzxX-pMsJVin8Rcp4xh_MyzbvpPqNgUikp9Ao

To claim this, I am signing this object:

import logging
import json
import google.oauth2.credentials
import time
from google.assistant.library import Assistant
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject, QThread
from google.assistant.library.event import EventType