Skip to content

Instantly share code, notes, and snippets.

@mikroskeem
mikroskeem / get_shell.c
Last active August 30, 2018 16:03
A script to get Arch Linux ARM rootfs running in proot on Android (Termux)
/*
* clang -static -O2 get_shell.c get_shell
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>
int main(int argc, char *argv[]) {
import macros, times, strutils, tables
type
Data* = object
value*: int
fvalue*: float
tvalue*: Time
Container* = object
desc*: string

Basic idea: A Nim DSL that describes the game model declaratively

There is a raw list/sequence of the data for fast iteration over all elements. The implementation should be either based on an ordinary contiguous sequence or something like: http://plflib.org/colony.htm which is essentially a linked list of growing arrays so that no reallocations are required.

In addition to the contiguous storage there can be multiple indexes into the data. The indexes can be hash based or based on a BTree depending on whether ranges queries need to be supported. There is always a primary key of type integer that can be used to index the contiguous array.

An example:

@obscurerichard
obscurerichard / pull-request-poetry.md
Last active March 26, 2021 15:19
pull-request-poetry.md

Pull request poetry

by Richard Bullington-McGuire richard@obscure.org @obscurerichard on GitHub and Twitter

Use these as comments in pull requests in order to charm the project owner into taking action on the pull request.

Initial ticklers

lonely pull request
the completist in me pines
for its prompt closure
@varqox
varqox / recording_application_and_microphone.md
Last active March 7, 2024 17:59
How to record multiple applications and microphone into one audio file on Linux using PulseAudio

How to record multiple applications and microphone into one audio file on Linux

Step 0. Terminology

Sinks are for output, sources are for input. To stream source to sink a loopback must be created. More shall you find there.

Step 1. Create output sink that will be recorded

Our output sink will be named recording.

pacmd load-module module-null-sink sink_name=recording sink_properties=device.description=recording
# nim c -r --threads:on --gc:orc
import cpuinfo, os, random, locks, deques
type
WorkReq = ref object
id: int
WorkRes = ref object
id: int
const
intrin = "<x86intrin.h>"
{.localPassC: "-msse4.2".}
type
M128i {.importc: "__m128i", header: intrin, bycopy.} = object
const
SIDD_CMP_RANGES = 0b0000_0100'i32
SIDD_NEGATIVE_POLARITY = 0b0001_0000'i32
@genotrance
genotrance / sciter.nim
Last active July 13, 2020 03:38
Nim wrapper for sciter using nimterop
import nimterop/[cimport]
cIncludeDir(@[
"/usr/include/gtk-3.0",
"/usr/include/glib-2.0",
"/usr/lib/x86_64-linux-gnu/glib-2.0/include",
"/usr/include/pango-1.0",
"/usr/include/cairo",
"/usr/include/gdk-pixbuf-2.0",
"/usr/include/atk-1.0"
@haxscramper
haxscramper / languages-and-vms.md
Last active March 16, 2024 19:45
languages-and-vms
@mmtrt
mmtrt / fixdd
Last active April 28, 2024 01:14
[ROOT] [Magisk] [Service.d] [Script] [Fix] DriveDroid on Android 9+
#!/bin/sh
# run while loop for boot_completed status & sleep 10 needed for magisk service.d
while [ "$(getprop sys.boot_completed | tr -d '\r')" != "1" ]; do sleep 1; done
sleep 10
# save currently active function name
echo "$(ls -al /config/usb_gadget/g1/configs/b.1/)" | grep -Eo f1.* | awk '{print $3}' | cut -d/ -f8 > /data/adb/.fixdd
# loop