Skip to content

Instantly share code, notes, and snippets.

@lyndsysimon
lyndsysimon / protonmail_archiver.js
Last active June 10, 2024 19:53 — forked from apazzy/protonmail_archiver.js
Protonmail inbox cleaner
/* Protonmail cleanup scripts
* Works with ProtonMail v4.0.14 as of 2022-01-23
*
* Based on Lyndsy's Protonmail mass archiver:
* https://gist.github.com/lyndsysimon/e6a4a1becaddf09fe02c503793b545d6
*
* Usage:
* - Navigate to your inbox (or another folder/label, presumably)
* - Open your browser's developer tools' Javascript console
* - Paste in this script
@roberth
roberth / minimod.nix
Last active June 26, 2024 08:27
Simple and quick module system alternative + thoughts and tasks
/*
minimod: A stripped down module system
TODO Comparison:
- [ ] Come up with a benchmark "logic" using plain old functions and let bindings
- [ ] Write the benchmark for the module system
- [ ] Write the benchmark for POP?
- [ ] Qualitative comparison of extensibility in the context of composable
Nixpkgs packaging logic
TODO Fine-tuning:
@SuperSandro2000
SuperSandro2000 / prepare-commit-msg.sh
Last active November 12, 2023 23:13
prepare commit message for nixpkgs. put into .git/hooks/prepare-commit-msg
#!/usr/bin/env bash
# shellcheck disable=SC2034
COMMIT_MSG_FILE=$1 # file which contains the commmit message
# shellcheck disable=SC2034
COMMIT_SOURCE=$2 # eg commit
# shellcheck disable=SC2034
SHA1=$3 # eg head
perl -i -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE"
#!/bin/bash
set -eu
usage() {
cat >&2 <<'EOF'
usage: ./difflog $out1 $out2
Compare two Nix build logs, normalizing out boring differences.
This can be useful to test the effect of a change to build scripts,
@anna328p
anna328p / aig4tb.md
Last active April 6, 2024 13:31
Arch Installation Guide for Total Beginners

Arch Installation Guide for Total Beginners

Guide by anna328p/alienpirate5.

This is meant as a companion for the official Arch install guide: https://wiki.archlinux.org/index.php/Installation_guide

This document is a guide for installing Arch Linux from the live system booted with the official installation image.

This document will walk you through the Arch Linux installation process based on the Arch Wiki installation guide. You will need to refer to the wiki for links; this guide just explains the steps in more detail. Keep in mind that this

@danbst
danbst / home-etc.nix
Created December 27, 2019 15:17
Manage your /etc from home-manager (install home-manager as root)
{ config, pkgs, lib, ... }: {
imports = [
(import <nixpkgs/nixos/modules/system/etc/etc.nix>)
];
options.system.build.etc = lib.mkOption { type = lib.types.package; };
options.system.activationScripts.etc =
lib.mkOption { type = lib.types.unspecified; };
config = {
@jimmychu0807
jimmychu0807 / string-conversion.rs
Created November 21, 2019 10:20
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte

Okay, I've got a need to build Firefox from source, and I'd like to do that on a remote machine, and then copy build result back to my laptop. With Nix, using bastion host. I'll note details of my successful adventure.

Setup & Sources of knowledge

Here's the list of resources I've used actively:

Here's my setup:

@nmattia
nmattia / default.nix
Last active October 19, 2023 22:04
Report for runtime dependencies of a derivation
# MIT License, see below
#
# These are some helpers for figuring out the derivations attributes of runtime
# dependencies of a derivation, in particular the function `runtimeReport`. At
# the bottom of the file you can see it used on `hello`. Spoiler: glibc is a
# runtime dependency.
# For more info see
#
# https://nmattia.com/posts/2019-10-08-runtime-dependencies.html
@rpigott
rpigott / _swaymsg
Last active April 28, 2024 13:39
swaymsg zsh completions w/ sway command completion
#compdef swaymsg
typeset -A opt_args
__swaymsg() {
# Reuse socket path from command line if present
swaymsg ${(kv)opt_args[(I)-s|--socket]} "$@" 2>/dev/null
}
# _sway
# sway ipc {{{