Skip to content

Instantly share code, notes, and snippets.

View sjg's full-sized avatar

Steven Gray sjg

View GitHub Profile
@sjg
sjg / README.md
Last active February 24, 2024 01:49
Mapping, Counting, Recovering: Humanities through the Digital Lens' Workshop - UCL DH / QMU - March 2024

Mapping, Counting, Recovering: Humanities through the Digital Lens' Workshop - UCL DH / QMU - March 2024

Introduction

This workshop session will show you how to turn a raw data spreadsheet in excel into ann interactive digital map using some free online tools and some code on this page. Learn how to Geocode some data in a Google Sheet and then export the data onto geojson.io.

Tutorial Video Link

Tools used for this Example

@sjg
sjg / Instructions.md
Last active July 21, 2023 11:14
Touchtable Install Script

Execute Install Script from Powershell

  1. Open PowerShell (Windows key + R, type powershell and press Enter).
  2. Copy and Paste the following commands
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser 
irm get.scoop.sh | iex
Start-Process powershell.exe -Verb RunAs
@sjg
sjg / Instructions.md
Last active June 21, 2023 04:07
Install CE Apps - Windows

Execute Install Script from Powershell

  1. Open PowerShell (Windows key + R, type powershell and press Enter).
  2. Copy and Paste the following commands
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser 
irm get.scoop.sh | iex
Start-Process powershell.exe -Verb RunAs
@sjg
sjg / fix.sql
Last active October 26, 2021 10:48
Spatial Data Capture: Update Photo Locations Fix
ALTER TABLE photo_locations ADD `points` point DEFAULT NULL;
UPDATE photo_locations SET points = coords;
/* OR If your points coloum in a VARCHAR */
UPDATE photo_locations SET points = POINT(lon,lat);
# MYSQL 5.7.8
# CREATE FUNCTION `distance_old_user`(a POINT, b POINT) RETURNS double DETERMINISTIC
@sjg
sjg / mqtt-client.js
Created August 2, 2021 21:25
A Simple Node Client to connect to a MQTT Broker
var mqtt = require('mqtt');
var request = require('request');
var client = mqtt.connect('mqtt://test.mosquitto.org')
client.on('connect', function () {
console.log("");
console.log("Connected to MQTT Server");
client.subscribe('#')
})
@sjg
sjg / wordtranslate.php
Created February 16, 2018 10:57
Translate Special Characters for MS Word Content
$search = [ // www.fileformat.info/info/unicode/<NUM>/ <NUM> = 2018
"\xC2\xAB", // « (U+00AB) in UTF-8
"\xC2\xBB", // » (U+00BB) in UTF-8
"\xE2\x80\x98", // ‘ (U+2018) in UTF-8
"\xE2\x80\x99", // ’ (U+2019) in UTF-8
"\xE2\x80\x9A", // ‚ (U+201A) in UTF-8
"\xE2\x80\x9B", // ‛ (U+201B) in UTF-8
"\xE2\x80\x9C", // “ (U+201C) in UTF-8
"\xE2\x80\x9D", // ” (U+201D) in UTF-8
"\xE2\x80\x9E", // „ (U+201E) in UTF-8
@sjg
sjg / processImage.sh
Last active January 18, 2018 04:03
PixelStick Workflow - Convert PNG's or JPG's into 24bit BMP rotated for the pixelstick
# Process PixelStick Images in a folder
find "$@" -name "*.jpg" | while read file; do
echo "-------------------------------------------------------------------------------------"
echo "Rotating Image: $file"
convert "$file" -geometry x200 "$file"_resized.jpg
convert "$file"_resized.jpg -rotate 270 "$file"_rotated.jpg
echo "Creating 24bit bmp: "$file"_24.bmp"
convert "$file"_rotated.jpg -type truecolor "$file"_24.bmp
rm "$file"_rotated.jpg
rm "$file"_resized.jpg
@sjg
sjg / colorText.sh
Created November 23, 2016 14:14
Bash Commands to set the Text Colour in Bash
echo -e "\033[91m\xE2\x9c\x98 - Can't find text"
echo -e "\033[92m\xE2\x9c\x94 - Found Text"
@sjg
sjg / Constants.m
Created January 19, 2014 22:36
Various code samples for Google iOS SDK Blog Posts
NSString* const api_forecast_layers_cap = @"http://datapoint.metoffice.gov.uk/public/data/layer/wxfcs/all/json/capabilities?key=%@";
NSString* const api_obs_layers_cap = @"http://datapoint.metoffice.gov.uk/public/data/layer/wxobs/all/json/capabilities?key=%@";
@sjg
sjg / parseCSVFile.js
Last active December 27, 2015 20:39
Parse CSV File
<script>
var mapOptions = {
center: new google.maps.LatLng(51.5, -0.11),
zoom: 10,
mapTypeId: google.maps.MapTypeId.TERRAIN
}
var getTweets;
$(function() {