Skip to content

Instantly share code, notes, and snippets.


Seppi josefnpat

View GitHub Profile
josefnpat / serverlist.php
Created Mar 7, 2019
Simple Server List API
View serverlist.php
$mckey = "rcs";
$memcache = new Memcache;
$server = $memcache->get($mckey);
if($server == false){
$server = new stdClass();
$server->list = array();
josefnpat / callgrind.lua
Last active Feb 27, 2019
Callgrind module for Lua 5.1 / LuaJIT
View callgrind.lua
Copyright 2007 Jan Kneschke (
Copyright 2019 Josef Patoprsty (
Licensed under the same license as Lua 5.1
This is an alteration of the original lua-callgrind by Jan Kneschke.
josefnpat / avoider.p8
Last active Jan 1, 2019
avoid game in 560 characters
View avoider.p8
pico-8 cartridge //
version 16
function k(t,f,v)line(t.x+f[1],t.y+f[2],t.x+v[1],t.y+v[2])end
function o(t)f=nil for v in q(t.s)do if f then k(t,l,v)else f=v end l=v end k(t,l,f)end::_::r=rnd
if#a<n then
View slider.lua
Copyright (c) 2018, Josef Patoprsty
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
josefnpat / compareIndexed.lua
Last active Aug 30, 2018
Compare Indexed Tables
View compareIndexed.lua
function compareIndexed(t1,t2)
local t1_count = 0
for _,_ in pairs(t1) do t1_count = t1_count + 1 end
local t2_count = 0
for _,_ in pairs(t2) do t2_count = t2_count + 1 end
if t1_count ~= t2_count then
return false
for i,v in pairs(t1) do
if type(v) == "table" then
View !

Abusing Drupal's SA-CORE-2018-002

I have a random server in Frankfurt. It was just a dev server, but I knew that it had a Drupal install that I forgot to patch. I was running 7.56, and should have updated, but missed the SA-CORE-2018-002 patch on this server. (If you're not patched yet, shame on you!) This is a cautionary tale...

Note to reader: this was written originally to a friend over chat, so it's rather ... chatty...

A few days ago, I get an email from my VPS telling me that the CPU has been maxed out at 100% since 10 AM.


josefnpat /
Last active Oct 27, 2019
Notes on porting LÖVE games from 0.10.2 to 11.0.0

Here are some notes that I am keeping while porting RCS from 0.10.2 to 11.0.0.

It seems that when making a new audio source, it either makes new SoundData from two strings (source,type) instead of defaulting to to the "stream" type. The simplist solution is the following:

While this monkey patch may not work in every case, I suspect it would work in most. =
josefnpat /
Created Dec 21, 2017
Convert video for PS4
# Copy video, convert audio:
./bin/ffmpeg/bin/ffmpeg.exe -i $1 -c:v copy -c:a libmp3lame $2
# Convert video and audio:
./bin/ffmpeg/bin/ffmpeg.exe -i $1 -crf 22 $2.mp4
josefnpat /
Last active Oct 30, 2017
What is a Fantasy Console?

What is a Fantasy Console

  1. A Fantasy Console (FC) must not have existing hardware.

    E.g. The arduboy is not a fantasy console.

  2. A FC needs to have intentional restrictions not related to the hardware it is being deployed on.

    I feel adding the retro component (e.g. looks like X) to be defeating, as it might stifle the creation of new fantasy consoles. At the end of the day, a FC is based on a fantasy hardware product that is difficult to alter once released. For example; the fantasy console may only have a few MB of memory, whereas the system it is being deployed on may have GB of memory.

josefnpat / LICENSE
Last active Oct 27, 2017
RGB <=> HS[L|V]
Copyright 2011 Emmanuel Oga.
Licensed under a Creative Commons Attribution 3.0
Unported License (
You are free:
to Share — to copy, distribute and transmit the work
to Remix — to adapt the work