Skip to content

Instantly share code, notes, and snippets.

View xandkar's full-sized avatar
🤔
quis custodiet ipsos custodes?

Siraaj Khandkar xandkar

🤔
quis custodiet ipsos custodes?
View GitHub Profile
[("-f" "--flag") => (λ (flag arg1 arg2 ...) (do-stuff ...)) '("Command description." "arg1 description" "arg2 description" ...)]
(find-system-path 'run-file)
(define (find-git-dirs path)
(define (basename path)
(let-values ([(base name must-be-dir?) (split-path path)])
(match name
['same (string->path ".")]
['up (string->path "..")]
[name name])))
(define .git (string->path ".git"))
(find-files
(λ (path)
@xandkar
xandkar / eqc.md
Created December 13, 2021 20:16 — forked from efcasado/eqc.md
A gentle introduction to (Erlang) QuickCheck

Erlang QuickCheck

What is QuickCheck?

QuickCheck is a language for stating properties of programs.

?FORALL(X, nat(), X*X >= 0)
@xandkar
xandkar / jeep-mods.md
Created August 30, 2021 12:03 — forked from JayKickliter/jeep-mods.md
My Jeep mods
  • Teraflex Falcon Nexus EF 2.2 Steering Stabilizer
  • Teraflex Falcon Shocks 3.3 Adjustable Piggyback front & rear. Rear has skid plate.
  • 3" lift
  • TigerShark Super Winch 9500 With Synthetic Line
  • Metal cloak Frame built Front bumper
  • Metal cloak front and rear Control Arms
  • Metal cloak Rear Track Bar (installed 6Months ago.
  • Metal cloak Tie rod and Drag link
  • Teraflex Forged Adjustable front track bar
  • Dynatrac Progrip Brake system front & rear.
@xandkar
xandkar / add-p.md
Created July 8, 2021 16:58 — forked from mattlewissf/add-p.md
Lightning Talk: Git add -p

git add -p is your friend

git add -p is basically "git add partial (or patch)"

Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history. This feature can improve the quality of the commits. It also makes it easy to remove parts of the changes in a file that were only there for debugging purposes - prior to the commit without having to go back to the editor.

It allows you to see the changes (delta) to the code that you are trying to add, and lets you add them (or not) separately from each other using an interactive prompt. Here's how to use it:

from the command line, either use

  • git add -p
open SCaml;;
type amount = tz;;
type dest = unit contract;;
type threshold = nat;;
type keys = key list;;
type action =
| Transfer of amount * dest
| Change_keys of threshold * keys
open SCaml
type action =
| Transfer of {amount: tz; dest: unit contract}
| Delegate of key_hash option
| ChangeKeys of {threshold : nat; keys : key list}
type parameter =
{counter: nat; action: action; sigs : signature option list}
@xandkar
xandkar / ircbotframe.py
Created March 28, 2021 18:14 — forked from TerrorBite/ircbotframe.py
Python IRC chat bridge for Vanilla Minecraft
import socket
import threading
import re
import time
class ircOutputBuffer:
# Delays consecutive messages by at least 1 second.
# This prevents the bot spamming the IRC server.
def __init__(self, irc):
self.waiting = False
;; Peter Norvig - Programming Challange from Erann Gat:
;; http://www.flownet.com/ron/papers/lisp-java/
;; Given a list of words and a list of phone numbers, find all the ways that
;; each phone number can be expressed as a list of words.
;; Run: (main "word-list-file-name" "phone-number-file-name")
(defvar *dict* nil
"A hash table mapping a phone number (integer) to a list of words from the
input dictionary that produce that number.")