Skip to content

Instantly share code, notes, and snippets.

View spaceface777's full-sized avatar

Raul Hernandez spaceface777

View GitHub Profile
import os
import subprocess
import json
import urllib
import urllib.request
import urllib.parse
API_HOST = "hk4e-api-os.hoyoverse.com"
def get_wish_urls():
@spaceface777
spaceface777 / amalgamator.js
Last active June 22, 2021 16:14
C amalgamator for the Boehm garbage collector
const ENTRYPOINTS = ['extra/gc.c', 'include/gc.h']
const fs = require('fs')
const path = require('path')
const search_dirs = ['.', 'extra', 'include', 'include/private', 'include/extra']
function find(file) {
file = file.substring(file.lastIndexOf('/') + 1)
for (const dir of search_dirs) {
if (fs.readdirSync(dir).includes(file)) return path.join(dir, file)
import net.http
import x.json2
const (
secret = 'your_porkbun_api_secret'
key = 'your_porkbun_api_key'
api_url = 'http://porkbun.com/api/json/v3/dns'
// i.e. `your_subdomain.your_domain.com`
domain = 'your_domain.com'
@spaceface777
spaceface777 / client.v
Created February 1, 2021 10:45
CoreMidi V wrapper
import midi
fn my_cb(buf []byte, timestamp f64, data voidptr) {
println('EVENT @ $timestamp: $buf.hex()')
}
fn main() {
for i in 0 .. midi.port_count() {
println(midi.port_info(i))
}
@spaceface777
spaceface777 / termtris.v
Last active January 27, 2021 18:22
terminal tetris made with the term.ui V module
import rand
import time
import term.ui as tui
const (
block_size = 1 // pixels
field_height = 20 // # of blocks
field_width = 10
tetro_size = 4
timer_period = 250 // ms
@spaceface777
spaceface777 / mouse.v
Created September 26, 2020 13:23
linux terminal mouse input in V
import os
os.system('stty -icanon')
os.system('stty -echo')
println('\x1b[?1003h\x1b[?1015h\x1b[?1006h')
for signal in 0 .. 64 {
os.signal(signal, fn() {
os.system('stty icanon')
os.system('stty echo')
@spaceface777
spaceface777 / debug.v
Created July 15, 2020 19:43
V parser debugging
if p.mod == 'main' {
println('-1 | ${p.prev_tok:-20} | 0 | ${p.tok:-20} | 1 | ${p.peek_tok:-20} | 2 | ${p.peek_tok2:-20} | 3 | ${p.peek_tok3}')
}

Install Ubuntu chroot on Android

1. Install and open Termux

It's on the Play Store, this needs no further explanation lmao

Wakelock

In the Termux notification, click Acquire wakelock. This prevents Android from putting Termux to sleep,
and results in MUCH better performance when your phone's display is off.

2. Install dependencies