Skip to content

Instantly share code, notes, and snippets.

View xordspar0's full-sized avatar

Jordan Christiansen xordspar0

View GitHub Profile

This little Go program does not run the defer statement when you interrupt by pressing ctrl-C:

package main

import "fmt"

func main() {
 defer fmt.Println("Shutting down...")
@xordspar0
xordspar0 / main.lua
Created February 9, 2020 02:40
Minimal test case for weird love.event behavior
function love.handlers.myEvent(t)
print("In my event handler:")
print(getmetatable(t))
print(t.upper)
end
super = {
upper = "hello world"
}
@xordspar0
xordspar0 / fizzbuzz.wren
Last active June 6, 2019 15:06
A concurrent FizzBuzz implemented in Wren (ported from Go: https://play.golang.org/p/ssVH6Rg3-Z)
/*
* fizzbuzz.wren by Jordan Christiansen
*
* This is a concurrent implementation of FizzBuzz that shows off how to send
* and receive data from Fibers. It was ported from a Go implementation by Russ Cox:
* https://play.golang.org/p/ssVH6Rg3-Z
*/
class Generator {
static create() {
@xordspar0
xordspar0 / GameState.lua
Last active April 3, 2018 15:18 — forked from randomguyeatspotato/GameState.lua
Separate __parent from the metatable
local enabledFunctions = require("gamestates/enabledFunctions")
local function emptyFunction() end
local function index(t, key) return t.__parent[key] end
local function indexMeta(t, k) return enabledFunctions[key] and emptyFunction end
local function call(self) return setmetatable({__parent = self}, {__index = index}) end
local GameState = setmetatable({}, {__index = indexMeta, __call = call})
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- created on 2017-04-09 00:52:43 - tinyMediaManager 2.9.3.1 -->
<episodedetails>
<title>Episode 26</title>
<showtitle>Nichijou - My Ordinary Life</showtitle>
<rating>0.0</rating>
<votes>0</votes>
<season>1</season>
<episode>26</episode>
<uniqueid>4149349</uniqueid>
@xordspar0
xordspar0 / PKGBUILD
Created May 7, 2017 06:41
blackwidowcontrol-git
# Maintainer: Martchus <martchus@gmx.net>
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
# you also find the URL of a binary repository.
pkgname=blackwidowcontrol
pkgver=r10.e793f18
pkgrel=1
pkgdesc='Python script to enable macro keys of the Razer BlackWidow keyboard under GNU/Linux'
arch=('any')
@xordspar0
xordspar0 / movies-full.tsv
Last active February 14, 2017 02:07
A movie database derived from IMDb. Useful for doing classification.
We can't make this file beautiful and searchable because it's too large.
Title Year Country Language Director Running time Rating Genre
"#7DaysLater" 2013 Australia English Pearson, Daley (I) 7 7.5 Comedy
"#ATown" 2014 USA English Coe, Duncan (I) 10 9.2 Comedy
"#Adulting" 2016 USA English Marchbank, TJ 6 6.3 Comedy
"#lovemilla" 2013 Finland Finnish Nikki, Teemu 6 6.7 Comedy
"$5,000 Video" 2013 USA English Buress, Hannibal 4 6.3 Comedy
"$weepstake$" 1979 USA English Moore, Irving J. 60 5.9 Drama
"'Da Kink in My Hair" 2007 Canada English Granofsky, Anais 30 4.5 Comedy
"'Orrible" 2001 UK English Brigstocke, Dominic 30 6.7 Comedy
"'Til Death" 2006 USA English Alexander, Jason (I) 21 6.5 Comedy
@xordspar0
xordspar0 / movies-small.tsv
Last active November 19, 2016 21:13
A movie database derived from IMDb. Useful for doing classification.
Title Year Country Language Director Running time Rating Genre
#7DaysLater 2013 Australia English Pearson, Daley (I) 7 7.5 Comedy
#ATown 2014 USA English Coe, Duncan (I) 10 9.2 Comedy
#Adulting 2016 USA English Marchbank, TJ 6 6.3 Comedy
#lovemilla 2013 Finland Finnish Nikki, Teemu 6 6.7 Comedy
$5,000 Video 2013 USA English Buress, Hannibal 4 6.3 Comedy
$weepstake$ 1979 USA English Moore, Irving J. 60 5.9 Drama
'Da Kink in My Hair 2007 Canada English Granofsky, Anais 30 4.5 Comedy
'Orrible 2001 UK English Brigstocke, Dominic 30 6.7 Comedy
'Til Death 2006 USA English Alexander, Jason (I) 21 6.5 Comedy
0 1
0 2
0 24
1 0
1 21
1 27
2 0
2 23
2 29
3 4