Skip to content

Instantly share code, notes, and snippets.

View partisani's full-sized avatar

partisani

  • Guanambi, Bahia, Brazil
  • 09:00 (UTC -03:00)
View GitHub Profile
@davcam
davcam / README.md
Last active October 10, 2025 03:44
A zettelkasten/denote application in ad editor.

This gist describes simply/minimally how to extend the ad editor to use zettelkasten/Denote type notes using just four short bash scripts.

Below is a short description of ad, a couple of demos and the bash scripts needed to:

  • create "Denote" notes
  • create links to notes
  • open notes in ad from the links using ad's loading/plumbing mechanism
  • list notes in ad that link back (backlink) to the current one
@NickyMeuleman
NickyMeuleman / lib.rs
Created July 8, 2021 15:17
Rust .collect() an iterator into a HashMap
use std::collections::{HashMap, HashSet};
fn count_occurrences(message: &str) -> HashMap<char, usize> {
let unique: HashSet<char> = message.chars().collect();
unique
.iter()
.map(|&c| (c, message.matches(c).count()))
.collect()
}
@stevendesu
stevendesu / HMAC.js
Created April 30, 2020 16:18
A simple, open-source, HMAC-SHA256 implementation in pure JavaScript. Designed for efficient minification.
// To ensure cross-browser support even without a proper SubtleCrypto
// impelmentation (or without access to the impelmentation, as is the case with
// Chrome loaded over HTTP instead of HTTPS), this library can create SHA-256
// HMAC signatures using nothing but raw JavaScript
/* eslint-disable no-magic-numbers, id-length, no-param-reassign, new-cap */
// By giving internal functions names that we can mangle, future calls to
// them are reduced to a single byte (minor space savings in minified file)
var uint8Array = Uint8Array;
c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -c -o main.o main.c
c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -o main.gb main.o