Skip to content

Instantly share code, notes, and snippets.

View icebreaker's full-sized avatar
:octocat:
Code Gardening

Mihail Szabolcs icebreaker

:octocat:
Code Gardening
View GitHub Profile
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 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
Kaleidosium / fix_github.css
Last active July 2, 2020 20:47
Fix New GitHub Design Issues
/* ==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 <iamrifki0@gmail.com>
==/UserStyle== */
@-moz-document url-prefix("https://github.com/"), url-prefix("https://gist.github.com/") {
/* Add separators back to the file list. */
; https://web.archive.org/web/20190701203222/https://www.pcengines.ch/tp3.htm
; 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
NewEXE / ConvertToObj.cs
Last active January 3, 2024 09:35
Export Unity Game Objects to Wavefront OBJ
// On the basis: https://forum.unity.com/threads/export-obj-while-runtime.252262/
// 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
da-n / usb-unlock-luks.md
Created August 24, 2019 13:11
Unlock LUKS full disk with USB stick

Configuration for passwordless root filesystem

Source: https://www.howtoforge.com/tutorial/passwordless-encryption-of-linux-root-partition/

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
max1220 / non_blocking_popen.lua
Last active February 20, 2024 07:26
non-blocking popen for Lua(using ffi)
-- 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
ffi.cdef([[
void* popen(const char* cmd, const char* mode);
int pclose(void* stream);
int fileno(void* stream);
@TrevorSundberg
TrevorSundberg / download.js
Last active October 30, 2022 19:55
Download a file in JavaScript with Emscripten / WebAssembly.
function download(filenamePtr, dataPtr, size) {
const a = document.createElement('a')
a.style = 'display:none'
document.body.appendChild(a)
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
ruccho / Generate Normal Map for all frames.lua
Last active July 17, 2024 15:36
Lua script for Aseprite that generates normal map automatically from all frames of selected layers.
----------------------------------------------------------------------
-- 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")
end
@YukiSnowy
YukiSnowy / main.cpp
Last active October 8, 2023 13:56
example SDL2 Direct3D9 application
// g++ *.cpp -o d3d9 -lmingw32 -lSDL2main -lSDL2 -I/dxsdk/include -L/dxsdk/lib -DUNICODE -ld3d9 -ld3dx9
// http://blog.fourthwoods.com/2011/08/11/setting-up-mingw-for-directx/
// http://www.directxtutorial.com/Lesson.aspx?lessonid=9-4-4
#include <iostream>
using namespace std;
#include <SDL2/SDL.h>
#include <windows.h>