Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bb
(ns example.socket
(:require [clojure.java.io :as io])
(:import
java.net.UnixDomainSocketAddress
java.net.StandardProtocolFamily
[java.nio.channels ServerSocketChannel SocketChannel]
[java.nio ByteBuffer]
[java.nio.channels SocketChannel]
@neeasade
neeasade / debounce.clj
Created February 17, 2025 19:56 — forked from oliyh/debounce.clj
Debounce in Clojure on the JVM
(import '[java.util Timer TimerTask])
(defn debounce
([f] (debounce f 1000))
([f timeout]
(let [timer (Timer.)
task (atom nil)]
(with-meta
(fn [& args]
(when-let [t ^TimerTask @task]
@neeasade
neeasade / bspdeskjson2dot
Created February 4, 2023 17:07 — forked from emanuele6/bspdeskjson2dot
bspwm tree visualiser
#!/bin/sh --
# \
exec jq -Crf "$0" -- "$@"
def children:
objects |
.path as $p |
(.firstChild | objects | .path = $p + "/1"),
(.secondChild | objects | .path = $p + "/2") |
select(has("id"));
@neeasade
neeasade / Meowipsum
Created June 1, 2022 19:29 — forked from muse/Meowipsum
Basically cat speak.
#!/usr/bin/env python
# Made by 'Mirko van der Waal'
# Distributed under terms of the MIT license.
from random import randint
from sys import argv, exit
import getopt
mews = [
# 3
@neeasade
neeasade / Links in markdown.md
Last active July 30, 2021 14:58 — forked from jesstelford/Links in markdown.md
Putting links in code blocks on GitHub
@neeasade
neeasade / Documentation.md
Last active August 19, 2020 01:30 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@neeasade
neeasade / nixos.md
Created November 22, 2019 03:56 — forked from martijnvermaat/nixos.md
Installation of NixOS with encrypted root
@neeasade
neeasade / server.sh
Last active January 22, 2021 13:23
netcat http keyval memory store || clojure tic tac toe
#!/usr/bin/env bash
# a nc server thing that I was kinda curious if it would work
# depends on: nc (netcat), bash 4.0(hashmaps/assoc arrays)
port=4000
declare -A items
items[test]="woooooo"
# quick refresher:
@neeasade
neeasade / irc.md
Created March 24, 2019 14:15 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
@neeasade
neeasade / read_only_filesystem.py
Created January 18, 2019 14:10 — forked from cocagne/read_only_filesystem.py
Per-process, read-only filesystem view via Linux's unshare() system call
#!/usr/bin/python
import ctypes
import os
import sys
def err_exit( msg ):
print >> sys.stderr, msg
sys.exit(1)