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 / 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 / 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 / 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 / ViewController.m
Last active October 17, 2015 13:32
Programatic WebView
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
CGFloat screenHeight = screenRect.size.height;
UIWebView *webview=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, screenWidth, screenHeight )];
NSString *url=@"https://google.com/";
@sjg
sjg / README.txt
Last active October 19, 2015 19:51
TripSensr Codebase
# TripSensor Install Info
# Getting BU353-S4 GPS Device Working on Raspberry Pi
# ************************************************************
sudo apt-get -y install gpsd gpsd-clients python-gps
# Change file with settings
nano /etc/default/gpsd
# Default settings for gpsd.
@sjg
sjg / setupVM.sh
Created August 13, 2015 15:31
VM Setup for Data Science Course (BENVGSC4)
# Setup Script for BENVGSC4 Database Virtual Machine
# -- CENTOS VM Setup
# -- Machine Specs
# -- Author: Steven Gray, Jan 2015
# -- Version: 1.0
# Do not run this file -- this will not install all features, manually install these
# Setup System
yum -y install htop