Skip to content

Instantly share code, notes, and snippets.

View icebreaker's full-sized avatar
Code Gardening

Mihail Szabolcs icebreaker

Code Gardening
View GitHub Profile
View gist:611881e119a55bf3f452b91dc6013c45
UTF-8 encoded sample plain-text file
Markus Kuhn [ˈmaʳkʊs kuːn] <> — 2002-07-25 CC BY
The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.
Kaleidosium / fix_github.css
Last active July 2, 2020 20:47
Fix New GitHub Design Issues
View fix_github.css
/* ==UserStyle==
@name Fix New GitHub Design Issues
@namespace iamrifki
@version 1.0.1
@description Fixes several things I dislike about the new GitHub redesign
@author Dania Rifki <>
==/UserStyle== */
@-moz-document url-prefix(""), url-prefix("") {
/* Add separators back to the file list. */
View tp3.asm
; The disassembler was applied to a copy of TP 3.01A downloaded from WinWorld.
; I postprocessed the disassembly with a script to clean up spacing and column alignment.
; *** TURBO PASCAL version 3.01 A source code
; ***
; *** commented by Pascal Dornier
; *** all rights reserved
; "***
cseg $100 ; "COM file...
NewEXE / ConvertToObj.cs
Last active January 3, 2024 09:35
Export Unity Game Objects to Wavefront OBJ
View ConvertToObj.cs
// On the basis:
// How to use:
// Put file to Assets/Editor folder
// then select GameObject -> Export selected objects
// in Unity's main panel.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
da-n /
Created August 24, 2019 13:11
Unlock LUKS full disk with USB stick

Configuration for passwordless root filesystem


The process of entering the passphrase at boot time will now be automated using an USB memory stick. Instead of using a passphrase , the secret key on the USB will decrypt the encrypted volumes. Connect an USB stick to the VM and locate it using the dmesg command. It is detected as /dev/sdb in my VM.

The secret key of 8192 random byte is extracted from the usb stick using the dd command.

dd if=/dev/sdb of=/root/secret.key bs=512 skip=4 count=16
max1220 / non_blocking_popen.lua
Last active February 20, 2024 07:26
non-blocking popen for Lua(using ffi)
View non_blocking_popen.lua
-- Implements a basic binding for popen that allows non-blocking reads
-- returned "file" table only supports :read(with an optional size argument, no mode etc.) and :close
local function non_blocking_popen(cmd, read_buffer_size)
local ffi = require("ffi")
-- C functions that we need
void* popen(const char* cmd, const char* mode);
int pclose(void* stream);
int fileno(void* stream);
TrevorSundberg / download.js
Last active October 30, 2022 19:55
Download a file in JavaScript with Emscripten / WebAssembly.
View download.js
function download(filenamePtr, dataPtr, size) {
const a = document.createElement('a') = 'display:none'
const view = new Uint8Array(Module.HEAPU8.buffer, dataPtr, size)
const blob = new Blob([view], {
type: 'octet/stream'
const url = window.URL.createObjectURL(blob)
a.href = url
ruccho / Generate Normal Map for all frames.lua
Last active February 12, 2024 01:41
Lua script for Aseprite that generates normal map automatically from all frames of selected layers.
View Generate Normal Map for all frames.lua
-- Generate Normal Map
-- It works only for RGB color mode.
if app.apiVersion < 1 then
return app.alert("This script requires Aseprite v1.2.10-beta3")
YukiSnowy / main.cpp
Last active October 8, 2023 13:56
example SDL2 Direct3D9 application
View main.cpp
// g++ *.cpp -o d3d9 -lmingw32 -lSDL2main -lSDL2 -I/dxsdk/include -L/dxsdk/lib -DUNICODE -ld3d9 -ld3dx9
#include <iostream>
using namespace std;
#include <SDL2/SDL.h>
#include <windows.h>