Skip to content

Instantly share code, notes, and snippets.

Clack clack click clack

Gergely Nagy algernon

Clack clack click clack
View GitHub Profile
algernon / Sketch.ino
Created Feb 24, 2019
Kaleidoscope Sticky key plugin
View Sketch.ino
#include "StickyKey.h"
kaleidoscope::plugin::StickyKey StickyW(Key_W), StickyX(Key_X);
algernon /
Created Oct 7, 2018
git + hub command to send a PR w/ auto-created branch
#! /bin/sh
## Place me on the PATH, as `git-send-github-pr`, and then `git send-github-pr HEAD^1`.
## The script will create a new branch, send the PR, then go back to wherever you were.
## (C) 2018 Gergely Nagy, released under the MIT license.
LAST_PR_ID="$(git branch --list 'github-pr/*' | cut -d/ -f2- | sort -n | tail -n 1)"
N="$(expr ${LAST_PR_ID} + 1)"
hub checkout -b "github-pr/${N}" ${1}

Keybase proof

I hereby claim:

  • I am algernon on github.
  • I am algernon ( on keybase.
  • I have a public key whose fingerprint is 10E6 5DC0 45EA BEFC C519 3A26 AC1E 90BA C433 F68F

To claim this, I am signing this object:

View logic-of-sleep.hy
(import [adderall.dsl [*]]
(require adderall.dsl)
(defn awake-too-longᵒ [last-sleep-time]
(project [last-sleep-time]
(if (> (- (time) last-sleep-time) 14)
algernon / fizzbuzzbeep.hy
Last active Dec 16, 2015
FizzBuzzBeep in hy.
View fizzbuzzbeep.hy
#! bin/hy
(def targets {3 "fizz" 5 "buzz" 7 "beep"})
(defn match [n factors]
(filter (lambda [x] (= 0 (% n x))) factors))
(defn fizzbuzz [n]
(let [[factors (.keys targets)]
[matches (match n factors)]]
algernon / fizzbuzz.hy
Last active Dec 15, 2015
FizzBuzz in Hy
View fizzbuzz.hy
#! bin/hy
; -*- mode: lisp; mode: paredit -*-
(import fizzbuzz-macros)
(defn fizzbuzz [n]
(let [[result ""]]
(if (zero? (% n 3))
(setv result (+ result "fizz")))
(if (zero? (% n 5))
algernon / fizzbuzz-logic.clj
Last active Dec 12, 2015
My feeble attempt at implementing FizzBuzz using core.logic, one which can be run back and forth aswell. Requires core.logic 0.8.0-rc3-SNAPSHOT or later.
View fizzbuzz-logic.clj
(refer 'clojure.core :exclude [==])
(use '[clojure.core.logic])
(require '[clojure.core.logic.fd :as fd])
(require '[clojure.test :as t])
(defn multo
"Ensure that `n` is a multiplicate of `div`."
[n div]
(fresh [x]
algernon / fizzbuzz-seq.clj
Created Feb 10, 2013
A fizzbuzz implementation that produces a lazy list of results.
View fizzbuzz-seq.clj
(defn fizzbuzz-seq
(letfn [(nil-prefix [n s]
(concat (take n (cycle [nil])) [s]))]
(map #(let [s (or %4 %2 %3 (inc %1))] s)
(cycle (nil-prefix 2 "Fizz"))
(cycle (nil-prefix 4 "Buzz"))
(cycle (nil-prefix 14 "FizzBuzz")))))
algernon / python-lisp-hybrid
Created Feb 4, 2013
A python "dialect" with significant parens. The point is, any whitespace at the beginning of line that is used for indentation must be replaced by opening parens, and to end a block, you must close all relevant parens.
View python-lisp-hybrid
def foobar(blah):
((for i in range(1, 10):
((((print "blah: %s" % blah))))))
algernon / dance.bas
Created Nov 25, 2012
My very first program, ever
View dance.bas
10 PRINT CHR$(27);"N"
20 PRINT "\o/"
30 PRINT " | "
40 PRINT "/ \"
50 FOR I=1 TO 1000: NEXT
60 PRINT CHR$(27);"N"
70 PRINT " o "
80 PRINT "/|\"
90 PRINT "/ \"
100 FOR I=1 TO 1000: NEXT
You can’t perform that action at this time.