Skip to content

Instantly share code, notes, and snippets.

View snodnipper's full-sized avatar
🚀

Ollie Snowden snodnipper

🚀
  • Earth
View GitHub Profile
@snodnipper
snodnipper / WtfCreator.java
Created December 8, 2022 09:24 — forked from nikialeksey/WtfCreator.java
Joshua Bloch Wtf.java break-in
import org.apache.commons.math3.analysis.interpolation.NevilleInterpolator;
public class WtfCreator {
public static void main(String[] args) {
var text = "Hello, world!\n";
double[] x = new double[text.length() + 1];
double[] y = new double[text.length() + 1];
for(var i = 0; i < text.length(); i++) {
x[i] = i;
#!/bin/bash
gradle init --type java-library --project-name jvm-library --dsl groovy --test-framework junit-jupiter --package uk.co.snodnipper.blah
  1. Save index.html in a directory
  2. From macOS execute python -m SimpleHTTPServer 8000
  3. Browse http://localhost:8000/

Keybase proof

I hereby claim:

  • I am snodnipper on github.
  • I am snodnipper (https://keybase.io/snodnipper) on keybase.
  • I have a public key ASAwQEXQ2KfFIhORLAXfxcIsEAuBAOwarLOoey4VyGaTogo

To claim this, I am signing this object:

@snodnipper
snodnipper / InstallDocker.sh
Created March 10, 2017 17:24
InstallDocker.sh
#!/bin/bash
#======================================================================
# Prepare Docker Installation
# https://docs.docker.com/engine/installation/linux/ubuntulinux/#/install-the-latest-version
#======================================================================
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
@snodnipper
snodnipper / pantanal_osm.xml
Created October 8, 2016 10:56
Crude extent of pantanal 'eyeballed' from public domain wikipedia content, see: https://en.wikipedia.org/wiki/File:Pantanal_55.76W_15.40S.jpg
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' upload='true' generator='JOSM'>
<node id='-52575' action='modify' visible='true' lat='-13.50448483093' lon='-62.08751677871' />
<node id='-52576' action='modify' visible='true' lat='-15.12250742666' lon='-59.97814177871' />
<node id='-52577' action='modify' visible='true' lat='-15.24973961872' lon='-55.10021209121' />
<node id='-52578' action='modify' visible='true' lat='-17.98657033036' lon='-54.35314177871' />
<node id='-52579' action='modify' visible='true' lat='-21.3379901871' lon='-55.31993865371' />
<node id='-52580' action='modify' visible='true' lat='-21.66508607218' lon='-56.72618865371' />
<node id='-52581' action='modify' visible='true' lat='-22.60133321822' lon='-57.82482146621' />
<node id='-52582' action='modify' visible='true' lat='-23.41032659659' lon='-58.70372771621' />
Course notes from http://courses.angularclass.com/courses/modern-javascript
Afterwards, we are encourage to complete: http://courses.angularclass.com/courses/angular-2-fundamentals
Note: not repeating too much here - just points to remember!
---
npm init <-- initialize a package.json by the CLI
npm run build <-- build just sits within package.json...and could be a simple "echo hello world"
@snodnipper
snodnipper / together.json
Last active July 22, 2016 13:22
hack day "demo" smart building sensor data
{
"meeting_rooms": {
"total_rooms": 50,
"available": 5
},
"restaurant": {
"special": "Fish and Chips!",
"special_image": "http://uploads.webflow.com/558957bd52a311f7085f767d/55983c6c6b6ebb72637456f8_codandchips.png"
},
"is_service_desk": {
@snodnipper
snodnipper / run.sh
Created April 29, 2016 19:21
Checkout Google Fonts and create Mapbox PBFs
#!/bin/bash
git clone git@github.com:google/fonts.git
git clone git@github.com:mapbox/node-fontnik.git
cd node-fontnik/
npm install
cd ..
echo "converting fonts"
find ./fonts/apache -type f -name *.ttf | sed -e 's/\(.*\/\)\([^/]*\)\(.ttf\)$/mkdir -p mbfonts\/\2;.\/node-fontnik\/bin\/build-glyphs \1\2\3 mbfonts\/\2 /g' | bash
@snodnipper
snodnipper / 2.vrt
Last active December 24, 2015 09:51
Using stock tools, I couldn't see an easy way to transform multiple columns simultaneously. Still, one could write out three separate files. See: https://github.com/snodnipper/bng-transformations/tree/master/examples/ogr2ogr
<OGRVRTDataSource>
<OGRVRTLayer name="process">
<SrcDataSource>process.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs +nadgrids=/Users/osnowden/code/bng-transformations/OSTN02_NTv2.gsb</LayerSRS>
<GeometryField encoding="PointFromColumns" x="MBR_XMIN" y="MBR_YMIN"/>
</OGRVRTLayer>
</OGRVRTDataSource>