Skip to content

Instantly share code, notes, and snippets.

View anonimitoraf's full-sized avatar

Rafael Nicdao anonimitoraf

View GitHub Profile

(use-package treesit-auto :demand t :config (progn (setq treesit-auto-install t) (global-treesit-auto-mode +1)

(defun treesit-auto-for-each (fn) (cl-loop for recipe in treesit-auto-recipe-list do

@mikeananev
mikeananev / virtual_threads.clj
Last active October 15, 2023 01:23
Java 19 virtual threads and Clojure
(ns user
(:import (java.util.concurrent Executors)))
;; Thread factory for virtual threads
(defn thread-factory [name]
(-> (Thread/ofVirtual)
(.name name 0)
(.factory)))
;; Define an executor which just produce a new virtual thread for every task
@DesignByOnyx
DesignByOnyx / README.md
Last active June 25, 2024 16:30
A script for setting up a project to use semantic-ui-less

This script was inspired by this blog post - however I found the technique to be a little insufficient. Many thanks to Artem Butusov as I would not have been able to do this without his blog post.

This script is intended to be used with semantic-ui-react projects. If you are just using semantic-ui, then you may need to do some other troubleshooting... I don't know as I haven't tested. From what I can tell everything should work just fine.

Before we get started

This process is completely different from the one described in the blog post above. This script is intended to do everything for you - no manual copying or updating code is required. If you have already followed

@mbleigh
mbleigh / firebase.json
Created August 2, 2016 18:42
Firebase Hosting for apple-app-site-association
{
"hosting": {
"headers": [
{
"source": "/.well-known/apple-app-site-association",
"headers": [{"key": "Content-Type", "value": "application/json"}]
}
]
}
}
@epicserve
epicserve / redis_key_sizes.sh
Last active June 29, 2024 03:41
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
@benjchristensen
benjchristensen / FuturesB.java
Last active December 12, 2023 09:36
FuturesB.java Example of using Futures for nested calls showing how it blocks inefficiently.
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@ghoseb
ghoseb / ns-cheatsheet.clj
Last active May 20, 2024 13:01 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.