Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊

Thomas ten Cate ttencate

🍊
View GitHub Profile
View dmesg.out
[ 0.000000] random: get_random_bytes called from start_kernel+0x42/0x4b7 with crng_init=0
[ 0.000000] Linux version 4.13.5-1-ARCH (builduser@tobias) (gcc version 7.2.0 (GCC)) #1 SMP PREEMPT Fri Oct 6 09:58:47 CEST 2017
[ 0.000000] Command line: initrd=\initramfs-linux.img root=PARTUUID=4a405e71-b7a3-416e-8f15-a15debbfebfa rw
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000086fff] usable
@ttencate
ttencate / alakajam.service
Last active Sep 25, 2017
Alakajam systemd unit
View alakajam.service
# Usage:
# - Put this content into /etc/systemd/system/alakajam.service
# - systemctl enable alakajam
# - systemctl start alakajam (or systemctl restart apache)
[Unit]
Description=Alakajam server
Requires=network.target
After=network.target
View gist:681431d36450f5dc8f284d8e287c233b
typedef enum{
response,
animation,
idle,
load
} phase_state;
struct AI_gov_info{
phase_state phase;
phase_state prev_phase;
View PhysicsTests.kt
@Test
fun forceMovesObject() = physicsTest {
- " "
- " A "
- " "
A isPushed right
A shouldMove right
@ttencate
ttencate / Makefile
Created Feb 23, 2017
The best Makefile ever
View Makefile
ifeq ($(MAKECMDGOALS),me a sandwich)
.PHONY: me a sandwich
me a:
@true
sandwich:
@if [[ $$(id -u) == "0" ]]; then \
echo "Okay."; \
else \
echo "What? Make it yourself."; \
false; \
@ttencate
ttencate / sorceress.py
Created Aug 20, 2016
Finds arrangements of rooms in a 4x4 grid using all possible room types, where each wall either has a door or not
View sorceress.py
#!/usr/bin/python3
class Piece:
def __init__(self, mask):
self.up = bool(mask & 1)
self.down = bool(mask & 2)
self.left = bool(mask & 4)
self.right = bool(mask & 8)
@ttencate
ttencate / sorceress.py
Created Aug 19, 2016
Python program to fit all possible tiles into a 4x4 grid, where each tile side either has a door or not.
View sorceress.py
#!/usr/bin/python3
class Piece:
def __init__(self, mask):
self.up = bool(mask & 1)
self.down = bool(mask & 2)
self.left = bool(mask & 4)
self.right = bool(mask & 8)
View BaseSettings.java
package com.frozenfractal;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.utils.Json;
import java.util.Locale;
public class BaseSettings {
protected final Preferences prefs;
View gist:96e8896f944a097785caa0394f3e17dc
addListener(new InputListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
if (event.getTarget() == DefaultDialog.this && x < 0 || y < 0 || x > getWidth() || y > getHeight()) {
hide();
return true;
}
return false;
}