This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=utf8 | |
# Copyright (C) 2010 Saúl ibarra Corretgé <[email protected]> | |
# | |
""" | |
pydmesg: dmesg with human-readable timestamps | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* 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 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask import render_template | |
import csv | |
import json | |
app = Flask(__name__) | |
@app.route('/') | |
def my_runs(): | |
runs = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
OlderNewer