Skip to content

Instantly share code, notes, and snippets.

View beyondlimits's full-sized avatar

beyondlimits

View GitHub Profile
/*
This is extremely basic HTTP server.
Thing is that I don't want to provide Content-Length.
The problem is that when I close the connection from server side,
Firefox and curl most the times claim the connection is broken.
Without closing the connection they're stuck.
What I'm doing wrong?
*/
using System.IO;
While normal people solve crosswords or sudoku, computer nerds are:
- solving Karnaugh maps of BCD-to-7-segment-display or other decoders
- converting Lambda Calculus terms to their equivalent SKI calculus terms
<?php
function hexdump($data, $line = 16, $pos = 0)
{
$pad = $line * 3;
foreach (str_split($data, $line) as $chunk) {
$hex = implode(' ', str_split(bin2hex($chunk), 2));
$ascii = preg_replace('/[^\x20-\x7E]/', '.', $chunk);
printf("%04x: %-{$pad}s |%-{$line}s|\n", $pos, $hex, $ascii);
CC0 1.0 Universal
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the
@beyondlimits
beyondlimits / formdata.lua
Created July 9, 2018 19:56
Minetest formspec context general idea.
local original_show_formspec = minetest.show_formspec
local original_register_on_player_receive_fields = minetest.register_on_player_receive_fields
local formdata = {}
minetest.register_on_joinplayer(function(player)
formdata[player:get_player_name()] = {}
end)
minetest.register_on_leaveplayer(function(player)
group=thewild
gid=1000
user=thewild
uid=1000
fullname=TheWild
device=/dev/sdc1
mountpoint=/home/thewild
aptpackages="$mountpoint/apt/packages"
aptinstall="$mountpoint/apt/install"
f() while ! "$@"; do sleep 1; done
<?php
return function($html)
{
$allowedTags = array(
'body',
'p', 'div', 'span',
'b', 'i', 'u',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
'font',
#!/bin/bash
set -e
(
mkdir test
pushd test
git init
echo 'Hello, World!' > testfile
git add testfile
File list can be obtained by running either:
7z l FILE (for a short list)
7z l -slt FILE (for a long list)
Examination of the outputs of both commands led to following observations:
- Both commands produce output with common header when run with the same
archive file using the same version of 7-Zip.