Skip to content

Instantly share code, notes, and snippets.

@dazzag24
dazzag24 / Facewall.py
Created May 22, 2012 16:31 — forked from madzen/Facewall.py
Create an image grid from Facebook friend profile pictures
#!/usr/bin/python
###############################################################################
# Produce a collage (grid) of friend profile images from Facebook.
# Inspired by Vipin "swvist" Nair @ https://gist.github.com/2692786
###############################################################################
# Copyright (c) 2012 Madzen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#!/usr/bin/env python
import time
import os
import RPi.GPIO as GPIO
import eeml
from eeml import CosmError
GPIO.setmode(GPIO.BCM)
DEBUG = 1
LOGGER = 1
@dazzag24
dazzag24 / pydmesg
Created October 15, 2015 14:05 — forked from yongboy/pydmesg
#!/usr/bin/env python
# coding=utf8
# Copyright (C) 2010 Saúl ibarra Corretgé <[email protected]>
#
"""
pydmesg: dmesg with human-readable timestamps
"""
/**
*
* Requirements:
*
* json-c - https://github.com/json-c/json-c
* libcurl - http://curl.haxx.se/libcurl/c
*
* On Ubuntu these are installed using:
* sudo apt-get install libjson-c-dev libcurl3
*
/**
* example C code using libcurl and json-c
*
* Requirements:
*
* json-c - https://github.com/json-c/json-c
* libcurl - http://curl.haxx.se/libcurl/c
*
* Build:
* Note that you will need to edit the code with your own HoD API key
If you have a column named Key then you will have issues when doing this:
select * from Sectors where Key = 'bagder'
"Incorrect syntax near the keyword 'Key'."
This is because Key is a reserved keyword in SQL. To resolve this, simply place the column name in square brackets e.g.
select * from Sectors where [Key] = 'bagder'
@dazzag24
dazzag24 / app.py
Created November 18, 2018 19:44 — forked from mneedham/app.py
Mapping Strava runs using Leaflet and Open Street Map
from flask import Flask
from flask import render_template
import csv
import json
app = Flask(__name__)
@app.route('/')
def my_runs():
runs = []
@dazzag24
dazzag24 / osm_render_gps_waypoints.py
Created January 30, 2019 20:30
Rendering GPS traces from OSM
import requests
import xml.etree.ElementTree as ET
from PIL import Image
import numpy as np
# Area format is left, bottom, right, top
#AREA = [-1.4853, 53.3730, -1.4557, 53.3893]
AREA = [0.0422, 52.1648, 0.2204, 52.2532]
WIDTH = 1280
import requests
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
s = requests.Session()
# https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html
# backoff_factor (float) –
# A backoff factor to apply between attempts after the second try (most errors are resolved immediately
# by a second try without a delay). urllib3 will sleep for:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.