Skip to content

Instantly share code, notes, and snippets.

View Spaxe's full-sized avatar
🏹

Xavier Ho Spaxe

🏹
View GitHub Profile
@Spaxe
Spaxe / a_few_lines_of_text.txt
Created December 4, 2019 02:07
Intro to Python
This file contains just a few lines of text.
Not a lot.
Just a few.
@Spaxe
Spaxe / .block
Last active September 3, 2018 02:38
d3 stacked chart
license: mit
height: 300
scrolling: no
@Spaxe
Spaxe / index.html
Created May 9, 2018 00:34
Example ticks only at the end with time
<!DOCTYPE html>
<meta charset="utf-8">
<svg width="960" height="500"></svg>
<script src="//d3js.org/d3.v4.min.js"></script>
<script>
var svg = d3.select("svg"),
margin = {top: 20, right: 0, bottom: 20, left: 0},
width = svg.attr("width") - margin.left - margin.right,
height = svg.attr("height") - margin.top - margin.bottom,
@Spaxe
Spaxe / CSV to GeoJSON.ipynb
Created November 3, 2017 03:43
Converting CSV to GeoJSON Python Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Spaxe
Spaxe / index.html
Created August 23, 2017 11:09
This version works
<!DOCTYPE html>
<html>
<body>
<script src="https://unpkg.com/geobuf@3.0.0/dist/geobuf.js"></script>
<script src="https://unpkg.com/pbf@3.0.5/dist/pbf.js"></script>
<script>
const data = {
"type": "FeatureCollection",
"features": [
{
@Spaxe
Spaxe / data.js
Created August 23, 2017 10:39
Test case for geobuf to read empty
module.exports = {
"type": "FeatureCollection",
"features": [
{
"geometry": {
"coordinates": [
[
[
138.674968,
-34.811527
@Spaxe
Spaxe / apache.log
Created July 27, 2017 05:15
Baddie sniffing my server
This file has been truncated, but you can view the full file.
::ffff:54.66.187.126 - - [08/Jun/2017:11:01:54 +0000] "GET / HTTP/1.1" 302 52 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)"
::ffff:54.66.187.126 - - [08/Jun/2017:11:01:54 +0000] "GET / HTTP/1.1" 302 52 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)"
::ffff:54.66.187.126 - - [08/Jun/2017:11:01:54 +0000] "GET / HTTP/1.0" 302 40 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)"
::ffff:54.66.187.126 - - [08/Jun/2017:11:02:49 +0000] "GET / HTTP/1.1" 302 52 "-" "-"
::ffff:54.66.187.126 - - [08/Jun/2017:11:02:49 +0000] "GET https://charizard.it.csiro.au/ HTTP/1.1" 302 81 "-" "-"
::ffff:54.66.187.126 - - [08/Jun/2017:11:04:05 +0000] "GET / HTTP/1.0" 302 40 "-" "-"
::ffff:54.66.187.126 - - [08/Jun/2017:11:04:05 +0000] "GET / HTTP/1.0" 403 - "-" "-"
::ffff:54.66.187.126 - - [08/Jun/2017:11:04:15 +0000] "GET / HTTP/1.1" 403 - "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)"
::ffff:54.66.187.126 - - [08/Jun/2017:11:04:15 +0000] "GET /
@Spaxe
Spaxe / gist:c0489ab55477c462e756a4e0b16523e0
Last active June 7, 2017 00:18
PyCon AU bulk tickets

Previously available only to elite level sponsors, our corporate concierge ticket service is now open to all volume buyers on the Contributor level.

If your company is looking to send 3+ developers to PyCon Australia, we can work with you by offering:

Single-sale, multiple registration: we invoice you once, you get a number of full-discount vouchers to Contributor-level tickets. Individual attendees can register using these vouchers, at their convenience, up to one week before the conference.

Reserved seatings for the tutorials. We will reserve you seats at the tutorials of your choice, so your developers can register even after tutorials are officially sold out. This is a limited time offer for obvious reasons: we expect tutorials to sell out fast!

Your logo as a sponsor! Your company logo will appear on our website, conference screens and banners as a valuable contributor to our conference, at the "Standard" sponsor level.

@Spaxe
Spaxe / numbergrid.py
Created May 8, 2017 05:51
Interpolation
#!/usr/bin/env python3
'''Interpolates numeric datasets'''
import sortedcontainers
def mix(a, b, ratio):
'''Return a if raio is 0, b if ratio is 1, and between a and b for a ratio inbetween.'''
return a + (b - a) * ratio
def interpolate(sorted_container, interval):
@Spaxe
Spaxe / index.html
Last active September 13, 2021 01:12
WebGL 2.0 RGB Triangle Example
<!DOCTYPE html>
<html>
<head>
<title>WebGL 2.0 Simple Example</title>
</head>
<body style="margin: 0">
<canvas id="draw-target"></canvas>
<script type="vertex" id="vs">
#version 300 es