Skip to content

Instantly share code, notes, and snippets.

View iomonad's full-sized avatar
🍋
λ

iomonad iomonad

🍋
λ
  • 06:48 (UTC +03:00)
View GitHub Profile
@iomonad
iomonad / images.clj
Created July 15, 2023 09:52
Compress Image in Pure Clojure
(ns arkana.lib.images
"Image manipulation namespace, provides some
utilities to compress & deal with images formats"
(:import java.io.File
java.io.FileOutputStream
javax.imageio.ImageIO
javax.imageio.IIOImage
javax.imageio.ImageWriteParam
java.awt.image.BufferedImage)
(:require [clojure.java.io :as io]))
@iomonad
iomonad / octal_x86.txt
Created May 15, 2023 08:14 — forked from seanjensengrey/octal_x86.txt
x86 is an octal machine
# source:http://reocities.com/SiliconValley/heights/7052/opcode.txt
From: [email protected] (Mark Hopkins)
Newsgroups: alt.lang.asm
Subject: A Summary of the 80486 Opcodes and Instructions
(1) The 80x86 is an Octal Machine
This is a follow-up and revision of an article posted in alt.lang.asm on
7-5-92 concerning the 80x86 instruction encoding.
The only proper way to understand 80x86 coding is to realize that ALL 80x86
@iomonad
iomonad / sortable.cljs
Created December 19, 2022 14:55 — forked from p4ulcristian/gist:95aa7b28e3568a1d3e45d27807859baf
@dnd-kit/sortable with drag overlay (clojurescript reagent)
(ns swordfish.sortable
(:require [reagent.core :as r]
["react" :as react]
["@dnd-kit/core" :refer [DndContext
closestCenter
KeyboardSensor
PointerSensor
TouchSensor
DragOverlay
useSensor
Iterate over disk pack in binding order looking for any disk not within true-jiggle range of *any* gate (a disk that is between gates)
if found:
all previous disks have true-jiggle centered on the gate they were aligned with
this disk has no jiggle
all subsequent disks have full-jiggle (can be moved from 0 up to 5)
return binder found
else:
all disks are in *a* gate. iterate again searching for a disk within true-jiggle of a false gate
if found:
this disk has false-jiggle
@iomonad
iomonad / GoogleDorking.md
Created November 29, 2022 21:37 — forked from sundowndev/GoogleDorking.md
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@iomonad
iomonad / auth.clj
Created June 25, 2022 22:33 — forked from Dangercoder/auth.clj
Pedestal JWT authentication interceptor
(ns interceptors.auth
(:require [cheshire.core :as json]
[clojure.spec.alpha :as s]
[clojure.walk :refer [postwalk]]
[clojure.core.async :as a])
(:import (java.net URL)
(com.auth0.jwk GuavaCachedJwkProvider UrlJwkProvider)
(com.auth0.jwt.interfaces RSAKeyProvider ECDSAKeyProvider)
(com.auth0.jwt.algorithms Algorithm)
(com.auth0.jwt JWT)
@iomonad
iomonad / web.clj
Created June 21, 2022 22:00 — forked from prestancedesign/web.clj
Ring session authentication with Reitit
(ns authexample.web
(:gen-class)
(:require [buddy.auth :refer [authenticated? throw-unauthorized]]
[buddy.auth.backends.session :refer [session-backend]]
[buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
[clojure.java.io :as io]
[compojure.response :refer [render]]
[reitit.ring :as ring]
[ring.adapter.jetty :as jetty]
[ring.middleware.params :refer [wrap-params]]
@iomonad
iomonad / make.conf
Created May 5, 2022 07:48
Work Thinkstation Make.conf
# ============================
# Core Flags
# ===========================
COMMON_FLAGS="-O2 -pipe -march=native"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
MAKEOPTS="-j21"
@iomonad
iomonad / weechat-light-terminal.conf
Created May 2, 2022 08:56 — forked from TauPan/weechat-light-terminal.conf
All my colour settings for a light (not white) terminal in weechat. I simply filtered my fset buffer with "color"
# Comma separated list of channels
/set colorize_nicks.look.blacklist_channels ""
# Comma separated list of nicks
/set colorize_nicks.look.blacklist_nicks "so,root"
# Whether to colorize input
/set colorize_nicks.look.colorize_input off
# If off, then use lazy matching instead
@iomonad
iomonad / tb_303.scd
Created April 1, 2022 12:04
TB303 on Supercollider
(
SynthDef(\impulseSync, {
|rate=1, bpm=135, barLengthInBeats=4, resetLength=1|
var reso = 96;
var clockFreqFull = bpm / 60 / barLengthInBeats * rate;
var clockFreq = clockFreqFull / resetLength;
var impSubDivs = Impulse.ar(clockFreqFull * barLengthInBeats * reso, 0);
var imp = PulseDivider.ar(impSubDivs, (barLengthInBeats * reso * resetLength).floor, barLengthInBeats * reso);
var clockPos = Phasor.ar(imp, clockFreqFull / SampleRate.ir, 0, 1, 0); var barCounter = PulseCount.ar(imp);
Out.ar(30, barCounter);