Skip to content

Instantly share code, notes, and snippets.

View iomonad's full-sized avatar
🍋
λ

iomonad iomonad

🍋
λ
  • Lutetia Parisiorum
View GitHub Profile
#include <stdio.h>
#include <stdint.h>
// Philips Sonicare NFC Head Password calculation by @atc1441 Video manual: https://www.youtube.com/watch?v=EPytrn8i8sc
uint16_t CRC16(uint16_t crc, uint8_t *buffer, int len) // Default CRC16 Algo
{
while(len--)
{
crc ^= *buffer++ << 8;
int bits = 0;
do
@keithharper
keithharper / query-stats-scenario1.edn
Last active August 7, 2024 13:01
query-stats for scenario1
(-> {:query '{:find [?album-name ?year]
:in [$ ?artist-name]
:where [[?artist :artist/name ?artist-name]
[?release :release/artists ?artist]
[?release :release/name ?album-name]
[?release :release/year ?year]
[(< ?year 1970)]]}
:args [db "John Lennon"]
:query-stats true}
d/query
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
@adi-g15
adi-g15 / arduino-cli-nodemcu.md
Created November 30, 2022 11:09
Using arduino / arduino-cli with NodeMCU (esp8266)

After a lot of searching over the network, this is what I have ended up with. This is intentionally made such that even a absolute beginner is able to follow, so uses fixed paths.

Note: I am not using the --additional-urls flag since it didn't work for me back then, you may try it.

Step 0

First ensure that your PC is detecting the NodeMCU atleast.

arduino-cli board list

How to make a small tweak to free software

The target audience for this is people who are beginners at software engineering and using linux. A lot of the information here may be obvious or already known to you. The language involved is C but you do not need to know any C to read this tutorial. I used mg to write this blog post. I used vs code to edit the source code.

This post is also available on gopher://tilde.team:70/0/~river/tweak-free-software

If you use a piece of free software and it's 99% perfect but there's just this one thing it does that annoys the hell out of you.. you can in theory just fix it! Here's a look at what doing that is like. Hopefully it inspires you, or you pick up a could tricks on the way!

Step 0: Have a problem

@p4ulcristian
p4ulcristian / gist:95aa7b28e3568a1d3e45d27807859baf
Created May 19, 2021 18:12
@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
@prestancedesign
prestancedesign / web.clj
Last active August 5, 2024 16:45
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]]
@Dangercoder
Dangercoder / auth.clj
Created November 21, 2020 18:42
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)
@digikar99
digikar99 / lisp-resources-digikar-2020.md
Last active September 10, 2024 08:40
If programming is more than just a means of getting things done for you, then Common Lisp is for you!
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active September 11, 2024 18:57
Docker Container Logging using Promtail