Skip to content

Instantly share code, notes, and snippets.

@gdm85
gdm85 / tiledMap.d
Last active August 29, 2015 13:57
Example loading of Tiled TMX map in D language
module tiledMap;
/*
Tiled TMX map loader example in D
Copyright (c) 2014, gdm85 - https://github.com/gdm85
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@gdm85
gdm85 / tilesetPacker.d
Last active August 29, 2015 13:57
This is a simple program that packs a Tiled tileset by removing all-black tiles, ideally you want to use this between Image2Map.py and MapWriter.py
/*
Tiled tileset packer
Copyright (c) 2014, gdm85 - https://github.com/gdm85
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
@gdm85
gdm85 / keybase.md
Created April 13, 2014 19:14
My keybase.io proof

Keybase proof

I hereby claim:

  • I am gdm85 on github.
  • I am gdm85 (https://keybase.io/gdm85) on keybase.
  • I have a public key whose fingerprint is A72D E9D8 CF1B EB84 9C75 9DA2 A597 D640 7735 77A4

To claim this, I am signing this object:

@gdm85
gdm85 / docker-oops.log
Created May 15, 2014 13:02
Kernel 3.2.0 oops with docker.io 0.11.1 (fb99f99), 2 cpus available
[13472.968715] BUG: unable to handle kernel NULL pointer dereference at 0000000000000001
[13472.969335] IP: [<ffffffff8110bbd9>] d_hash_and_lookup+0x38/0x66
[13472.969709] PGD a2c5c067 PUD 371fa067 PMD 0
[13472.970157] Oops: 0000 [#1] SMP
[13472.970528] CPU 1
[13472.970624] Modules linked in: veth ip6t_LOG nf_conntrack_ipv6 nf_defrag_ipv6 xt_addrtype ip6t_REJECT ip6table_filter xt_conntrack ip6_tables ipt_LOG xt_limit xt_tcpudp xt_state ipt_REJECT iptable_filter ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack ip_tables x_tables bridge stp aufs(C) ext2 loop snd_ens1370 processor pcspkr joydev thermal_sys psmouse snd_rawmidi snd_seq_device snd_pcm snd_page_alloc snd_timer snd soundcore parport_pc parport usbhid gameport evdev serio_raw hid i2c_piix4 i2c_core button virtio_balloon ext4 crc16 jbd2 mbcache dm_mod sg sr_mod cdrom ata_generic virtio_blk virtio_net floppy ata_piix uhci_hcd ehci_hcd libata scsi_mod usbcore usb_common virtio_pci virtio_ring virtio [last unloaded: scsi
@gdm85
gdm85 / amd64.diff
Created May 31, 2014 16:56
inconsistent bitcoin gitian builds
--- bad/sorted_amd64_1.txt 2014-05-31 18:49:57.372851256 +0200
+++ good/sorted_amd64_2.txt 2014-05-31 18:49:45.584851018 +0200
@@ -1,5 +1,6 @@
adduser_3.113ubuntu2_all.deb
+adduser_3.113ubuntu2_all.deb
anacron_2.3-14ubuntu1_amd64.deb
apt_0.8.16~exp12ubuntu10.16_amd64.deb
apt-utils_0.8.16~exp12ubuntu10.16_amd64.deb
@@ -38,9 +39,9 @@
@gdm85
gdm85 / sort_differences.diff
Created June 2, 2014 20:44
`sort -s -n' is not an option for those seeking determinism... This is the difference between sort output on VirtualBox VM and LXC VM
--- sorted list from VirtualBox.log 2014-06-02 21:59:57.572870668 +0200
+++ sorted list from LXC.log 2014-06-02 21:50:49.431921469 +0200
@@ -1,4 +1,8 @@
bitcoin-0.9.1/
+bitcoin-0.9.1/COPYING
+bitcoin-0.9.1/INSTALL
+bitcoin-0.9.1/Makefile.am
+bitcoin-0.9.1/Makefile.in
bitcoin-0.9.1/aclocal.m4
bitcoin-0.9.1/configure
@gdm85
gdm85 / grandchildren-onbuild-testcase.sh
Last active August 29, 2015 14:02
A testcase for bug about inheritance of ONBUILD traits
#!/bin/bash
set -e
mkdir -p base{1,2,3}
echo -e "FROM ubuntu:13.10\nRUN echo I am your grand father\nONBUILD RUN echo I am your father" > base1/Dockerfile
echo "FROM base1" > base2/Dockerfile
echo -e "FROM base2\nEXPOSE 1000" > base3/Dockerfile
@gdm85
gdm85 / make_binary_output.log
Created July 28, 2014 09:31
(docker issue #7265) make -j5 binary 2>&1 | tee make_binary_output.log
mkdir bundles
docker build -t "docker:master" .
Sending build context to Docker daemon 555.5 kB
Sending build context to Docker daemon 1.113 MB
Sending build context to Docker daemon 1.67 MB
Sending build context to Docker daemon 2.227 MB
Sending build context to Docker daemon 2.784 MB
Sending build context to Docker daemon 3.341 MB
Sending build context to Docker daemon 3.898 MB
Sending build context to Docker daemon 4.455 MB
@gdm85
gdm85 / port-testcase-7158.sh
Created September 9, 2014 09:59
testcase for port-in-use Docker recognition issue
#!/bin/bash
## @author gdm85
## testcase for inconsistent Docker port-in-use recognition
#
TMPD=$(mktemp -d) || exit $?
function cleanup() {
local CONTAINER="$1"
docker kill "$CONTAINER" >/dev/null && docker rm "$CONTAINER" >/dev/null
@gdm85
gdm85 / utils-use-native-urandom.diff
Last active August 29, 2015 14:06
Temptative patch to troubleshoot container id collision issue (updated at 15:15 UTC to add a mutex)
diff --git a/utils/utils.go b/utils/utils.go
index da6854b..0eb283a 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -2,12 +2,12 @@ package utils
import (
"bytes"
- "crypto/rand"
"crypto/sha1"