Skip to content

Instantly share code, notes, and snippets.

View geostarling's full-sized avatar

Jiří Špaček geostarling

  • Czech Technical University
  • Prague
View GitHub Profile
@discatte
discatte / seiko_dates.md
Created June 28, 2022 03:35
Seiko Movement Calibre Dates

Backup of the table from http://www.watchsleuth.com/seikodatefinder/?show=all To help determine date ranges of watch calibre movements from seiko.

Mvmt Caliber Start End Type
0114A 0114 . . Quartz
0124A 0124 . . Quartz
0138A 0138 . . Quartz
0139A 0139 . . Quartz
0159A 0159 . . Quartz
@0xabad1dea
0xabad1dea / copilot-risk-assessment.md
Last active September 11, 2023 10:21
Risk Assessment of GitHub Copilot

Risk Assessment of GitHub Copilot

0xabad1dea, July 2021

this is a rough draft and may be updated with more examples

GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?

Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to

@munificent
munificent / generate.c
Last active January 27, 2025 18:14
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@jirutka
jirutka / Makefile
Created November 13, 2017 22:34
Custom OpenLDAP overlay that adds a “virtual” attribute with person’s full name constructed from other attributes.
LDAP_SRC = ../../..
LDAP_BUILD = $(LDAP_SRC)
LDAP_INC = -I$(LDAP_BUILD)/include -I$(LDAP_SRC)/include -I$(LDAP_SRC)/servers/slapd
LDAP_LIB = $(LDAP_BUILD)/libraries/libldap_r/libldap_r.la \
$(LDAP_BUILD)/libraries/liblber/liblber.la
LIBTOOL = $(LDAP_BUILD)/libtool
CC = gcc
OPT = -O2 -Wall -Wno-discarded-qualifiers -Wno-format-extra-args -pedantic
DEFS =
@aldaris
aldaris / buildAM13.sh
Created April 4, 2017 08:05
Shell script to build OpenAM 13.0.0 from openam-public repository
#!/bin/bash
#Run buildDJ3.sh script first in the same folder from: https://gist.github.com/aldaris/fe234d76f3940c42ae9bb5aa69b8e98e
function build() {
mvn clean install
if [ $? -ne 0 ] ; then
exit 1;
fi
}

Racket #langs and the REPL

The Racket platform provides a robust set of tools for developing languages, mostly centered around the macro system and the #lang protocol, which allows providing arbitrary readers to convert text input to syntax objects representing Racket modules. The REPL is a bit more complicated, however, because it has different rules—each expression needs to be dynamically read, assigned lexical context, expanded, compiled, evaluated, and printed, all in real time. (In that sense, perhaps the phrase “REPL” oversimplifies what Racket is doing, but that’s a separate conversation.)

So how does Racket accommodate this in the face of completely arbitrary user-defined languages, some of which may not even support interactive evaluation in a traditional sense? Racket mostly solves this problem by having a related but distinct set of protocols for managing runtime interactions that operates alongside #lang.

Modules and the top level

Racket’s evaluation model divides pretty much ev

@jebberjeb
jebberjeb / saml.clj
Created September 27, 2016 18:46
Parse SAML metadata with clojure spec
(ns foo.saml
(:require
[clojure.spec :as s]
[clojure.string :as string]
[clojure.xml :as xml])
(:import
(java.io ByteArrayInputStream)))
(s/def :sso/Binding #{"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"})
(s/def :sso/attrs (s/keys :req-un [:sso/Binding ::Location]))
@nphyx
nphyx / terminalrc
Last active July 30, 2017 12:49 — forked from jlhg/terminalrc
Zenburn colours scheme for Xfce Terminalhttp://slinky.imukuppi.org/zenburnpage/
# Zenburn colours scheme for Xfce Terminal updated for Xfce4-terminal 0.6.3. Copy and paste the following in ${HOME}/.config/xfce4/Terminal/terminalrc:
ColorBackground=#404040
ColorForeground=#F6F3E8
ColorCursor=#8f8fafaf9f9f
ColorPalette=#3f3f3f3f3f3f;#e8e893939393;#9e9ecece9e9e;#f0f0dfdfafaf;#8c8cd0d0d3d3;#c0c0bebed1d1;#dfdfafaf8f8f;#efefefefefef;#3f3f3f3f3f3f;#e8e893939393;#9e9ecece9e9e;#f0f0dfdfafaf;#8c8cd0d0d3d3;#c0c0bebed1d1;#dfdfafaf8f8f;#efefefefefef
@14427
14427 / hkt.rs
Last active August 31, 2024 00:57
Higher-kinded type trait
use std::rc::Rc;
trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {