Skip to content

Instantly share code, notes, and snippets.

View evaporei's full-sized avatar
🔮
spell caster

Eva Pace evaporei

🔮
spell caster
View GitHub Profile
@evaporei
evaporei / tutorial.md
Created September 24, 2023 17:41
ssh mac (host) into linux (remote) in the same network (eg: wifi)

Linux

  1. Get your local IP address
$ ip route
default via IP1 dev wlan0 proto dhcp src IP2 metric 600 
IP3/24 dev wlan0 proto kernel scope link src IP2 metric 600
@evaporei
evaporei / .generate_cringe_key.sh
Created September 24, 2023 16:09
generate cringe key
#!/bin/bash
# pass name via $1
ssh-keygen -t rsa -b 4096 -f ~/.ssh/$1
@evaporei
evaporei / jack_grammar.txt
Created June 3, 2023 11:27
Jack grammar
--- program structure ---
// a Jack program is a collection of files, each should represent a class like the one below
class = "class" className '{' classVarDec* fnDec* '}' ;
classVarDec = ("static" | "field") type varName (',' varName)* ';' ;
fnDec = ("constructor" | "function" | "method") ("void" | type) fnName '(' paramList ')' fnBody ;
paramList = ( (type varName) (',' type varName)* )? ;
fnBody = '{' varDec* statements '}' ;
varDec = "var" type varName (',' type varName)* ';' ;
type = primitive | className ;
@evaporei
evaporei / artblocks_error.rs
Created January 20, 2022 18:49
ArtBlocks Error
// Cargo.toml dependencies:
// hex = "0.4.3"
// ethabi = "16.0.0"
use ethabi::*;
use ethabi::ParamType::*;
use ethabi::StateMutability::*;
fn main() {
@evaporei
evaporei / xor.rs
Created January 8, 2022 18:40
Xor in Rust cause HDL sucks
struct In {
a: bool,
b: bool,
}
#[derive(Debug, PartialEq)]
struct Out {
out: bool,
}
@evaporei
evaporei / boolean_algebra.js
Last active January 8, 2022 17:22
Boolean functions
const assert = require('assert')
function test(title, fn) {
try {
fn()
console.log(`✅ '${title}' test passed`)
} catch (error) {
console.error(`❌ '${title}' test failed`)
throw error
}
@evaporei
evaporei / contiguous-array-chunks.js
Last active October 11, 2021 14:23
JS contiguous array chunks
const getChunk = (arr, from, size) => {
const clampedFrom = (from + size) > arr.length
// Trying to get chunk bigger than end of array.
// Here we reduce `from` so that the chunk size is always preserved.
? arr.length - size
: from
return arr.slice(clampedFrom, from + size)
}
@evaporei
evaporei / assembly-script-migration-guide.md
Last active November 28, 2025 13:42
AssemblyScript Migration Guide

AssemblyScript Migration Guide

Up until now, subgraphs have been using one of the first versions of AssemblyScript (v0.6). Finally we've added support for the newest one available (v0.19.10)! 🎉

That will enable subgraph developers to use newer features of the AS language and standard library.

This guide is applicable for anyone using graph-cli/graph-ts below version 0.22.0. If you're already at a higher than (or equal) version to that, you've already been using version 0.19.10 of AssemblyScript 🙂

Note: As of 0.24.0, graph-node can support both versions, depending on the apiVersion specified in the subgraph manifest.

@evaporei
evaporei / linkedin-accept-invites.js
Created July 24, 2020 14:23
LinkedIn snippet for accepting all invites
document.querySelectorAll('ul.mn-invitation-list button.artdeco-button--secondary').forEach(btn => btn.click())
@evaporei
evaporei / category-theory-monad-javascript-flatmap.js
Last active November 28, 2025 13:44
Category Theory - Monad JavaScript flatMap
console.log('flatten list:', [1, 2, 3].flatMap(x => [x * 2])) // [2, 4, 6]