Skip to content

Instantly share code, notes, and snippets.

View novusnota's full-sized avatar
:accessibility:
be curious, do better, and remember — it's more fun to be competent

Novus Nota novusnota

:accessibility:
be curious, do better, and remember — it's more fun to be competent
View GitHub Profile
@novusnota
novusnota / build.zig
Created May 5, 2024 22:43 — forked from gwenzek/build.zig
Building with Zig and system LLVM
const std = @import("std");
const Build = std.Build;
pub fn build(b: *Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// Instead of using the classic b.addExecutable, we use a custom rule
// to compile with Zig, then optimize with LLVM.
const exe = addLLvmExecutable(b, .{
;; my_addr(MYADDR) get_jwa_method_id(103289) args(2) master_code ret(1) master_data
;; RUNVM +1 +4 +32
;; address exitcode c4' c5'
slice vm::invoke_get_addr(cell master_code, cell master_data) asm
"MYADDR // mc md my_addr"
"103829 PUSHINT // mc md my_addr get_jwa_method_id"
"2 PUSHINT // mc md my_addr get_jwa_method_id args"
"2 3 BLKSWAP // my_addr get_jwa_method_id args mc md"
"1 PUSHINT // my_addr get_jwa_method_id args mc md ret"
@novusnota
novusnota / min-char-rnn.py
Created April 9, 2024 17:49 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@novusnota
novusnota / add_this_snippet_to_your_fish_shell_config.fish
Created September 12, 2023 12:49
Simplest way of using https://sdkman.io/ under Fish Shell — add the snippet from the file below to your ~/.config/fish/config.fish and call it a day! No more how to use sdkman with fish issues, a simple wrapper is all you need.
# Simplest way of using https://sdkman.io/ under Fish Shell:
# Add the snippet from the file below to your ~/.config/fish/config.fish and call it a day!
# Note: while this trick works, it doesn't give you auto-completion options.
function sdk
bash -c "source '$HOME/.sdkman/bin/sdkman-init.sh'; sdk $argv[2..-1]"
end
@novusnota
novusnota / run.jl
Created October 27, 2022 11:28
A small Julia-based script, which allows usage of 'and' and 'or' keywords instead of '&&' and '||' infix operators in Julia programs.
#!/usr/bin/env julia
##
# A small script, written in Julia, which allows usage of 'and' and 'or' keywords instead of '&&' and '||' infix operators in Julia programs.
# Made out of desperation after reading this discussion: https://github.com/JuliaLang/julia/issues/5238
# Notice, that run.jl **doesn't** modify the original file.
#
# Use it simply so:
# $> julia run.jl <filename>
# or by giving the file execution rights and then running:
@novusnota
novusnota / d.sh
Last active June 2, 2023 12:01
Extremely simple and useful bash script for controlled tests inside clean environments provided by docker containers. Run it to quickly jump into docker container instance of your choice with network mode set to host, which means all your opened ports on host machine would be easily accessible from the container and vice versa! When you finish p…
#!/usr/bin/env bash
##
# 0. (A must) Leave a star on this GIST :P
# 1. Clone/download/copy-paste the this script
# 2. Give it rights to execute: `chmod +x d.sh`
# 3. Move it somewhere on your PATH and (optionally) rename it on the fly: `mv d.sh /usr/local/bin/d`
# 4. Now run it from anywhere: `d` or `d.sh` (if you didn't rename your file)
# 5. ???
# 6. Hooray! You're inside the container! Enjoy your stay & mess around as much as you want!
@novusnota
novusnota / .vimrc
Last active October 30, 2024 04:21
Простая конфигурация, конфиг Vim для тех, у кого русско-английская клавиатура. Для русскоязычных, короче (duh). Минималистичная, минимум плагинов, но с развёрнутым описанием каждой функции, настройки и команды.
" Простая конфигурация Vim для пользователей с русско-английской клавиатурой
" Как правило, русскоязычных (duh)
" Минималистичная, минимум плагинов, но с развёрнутым описанием каждой функции, настройки и команды
" Работает для Vim 8.*, скомпилированного по максимуму.
" Чистый конфиг, без использования менеджеров плагинов.
" Цветовые схемы вручную копировал в папку ~/.vim/
" Также, ручками добавил
" lightline и NERDTree в ~/.vim/pack/plugins/start,