Skip to content

Instantly share code, notes, and snippets.

View ianturton's full-sized avatar
🏠
Working from home

Ian Turton ianturton

🏠
Working from home
View GitHub Profile
@ThomasG77
ThomasG77 / README.md
Last active April 8, 2024 20:17
Run PyQGIS in Jupyter Notebook
@darribas
darribas / palindromes.ipynb
Last active September 18, 2017 10:26
Finding the longest palindrome in the UK
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import fiona
import click
from rasterio import features, Affine
def makeAffine(bounds, width):
xD = bounds[2] - bounds[0]
yD = bounds[3] - bounds[1]
cS = xD / float(width - 2)
height = int(yD / cS) + 1
@flakas
flakas / hc-sr04.ino
Created August 8, 2012 12:41
Modified Arduino Ping))) example to work with 4-Pin HC-SR04 Ultrasonic Sensor Distance Measuring Module
/* HC-SR04 Sensor
https://www.dealextreme.com/p/hc-sr04-ultrasonic-sensor-distance-measuring-module-133696
This sketch reads a HC-SR04 ultrasonic rangefinder and returns the
distance to the closest object in range. To do this, it sends a pulse
to the sensor to initiate a reading, then listens for a pulse
to return. The length of the returning pulse is proportional to
the distance of the object from the sensor.
The circuit: