Skip to content

Instantly share code, notes, and snippets.

@randomdude999
randomdude999 / tinysleep.asm
Last active June 28, 2023 19:11
tiny versions of the POSIX sleep utility (for x86 Linux)
; optimized version of https://reddit.com/comments/l4wfoo/_/gkrkhkb/
; usage:
; nasm tinysleep.asm
; chmod +x tinysleep
; ./tinysleep 5
bits 64
db 0x7F, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
db 0x02, 0x00, 0x3E, 0x00, 0x01, 0x00, 0x00, 0x00
db 0x78, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00
@lpereira
lpereira / jsonjit.c
Last active January 29, 2023 20:12
/* Maps a page of the request size near the text page that contains
* a symbol. Useful for hand-rolled JIT compilers to avoid indirect
* calls to symbols in a program on x86-64. (Part of the code here is
* a JIT compiler to encode JSON based on a struct descriptor, but it's
* not finished yet.)
*
* Written by L. Pereira <[email protected]>
*
* Thanks to Ole André V. Ravnås for the idea to use the NOREPLACE flag
* in mmap(), and to Paul Khuong for helping me make it more robust in
@chylex
chylex / filter.txt
Created May 25, 2018 14:04
uBlock Origin - Google search - Remove "People also search for"
! https://www.google.com/search
www.google.com##.exp-outline
www.google.com##[style="display: block; opacity: 1;"]
www.google.com##[data-hveid]>div:style(height: auto !important)
@namandixit
namandixit / math3d.h
Last active August 17, 2023 11:46
3D Linear Algebra Library in C99 (Tested with OpenGL)
/* This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@kouk
kouk / wtf8.py
Last active February 17, 2022 00:14
Python codec for Wobbly Transformation Format - 8-bit (WTF-8)
# -*- coding: utf-8 -*-
# To the extent possible under law, the author of this work, Konstantinos
# Koukopoulos, has waived all copyright and related or neighboring rights to
# "Python codec for Wobbly Transformation Format - 8-bit (WTF-8)". It is
# dedicated to the public domain, as described in:
# http://creativecommons.org/publicdomain/zero/1.0/
# This work is published from Greece and is available here:
# https://gist.github.com/kouk/d4e1faababf14b09b27f
from __future__ import unicode_literals, print_function
import six
@ruario
ruario / README.md
Last active July 16, 2024 17:56
This script provides a method for creating generic (cross-distro), installable, binary packages. The created packages include a log that makes uninstall easy.

Createpkg

Intro

This script provides a simple method for tracking software that you have built from source, or binaries that you want to repackage from another distribution. It also simplifies transferring the software to other machines for install or backup. It works as a nice secondary package management tool, without the need to work with complex, distro specific, build tools.