Skip to content

Instantly share code, notes, and snippets.

View spdegabrielle's full-sized avatar
🏠
Working from home

Stephen De Gabrielle spdegabrielle

🏠
Working from home
View GitHub Profile
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@tonyg
tonyg / 2d.rkt
Last active April 8, 2024 03:41
Playing with OpenGL in Racket
#lang send-exp racket/gui
(require sgl/gl)
(require sgl/gl-vectors)
(require pict)
(define texture%
(class object%
(init [(initial-bitmap bitmap)])
(field [width 0]
@Chubek
Chubek / FewlPP.rkt
Last active February 8, 2024 14:35
FewlPP.rkt -> C Preprocessor that adds Fork-Exec-Wait Loops
#!/usr/bin/racket
#lang racket
(define directives '())
(define bypasses '())
(define declarations '())
(define definitions '())
(define (process-line line)
@jackfirth
jackfirth / continuation-lessons.md
Last active June 26, 2023 13:54
Examples of how to build control flow structures with continuations

Lessons in Using Continuations

This gist contains examples of how to build different kinds of control flow structures in Racket using macros and continuations. Examples include:

  • Early exit from functions using a return statement.
  • Early exit from arbitrary expressions using a simple exception system.
  • Temporarily interrupting execution in order to check permissions.
@alex-hhh
alex-hhh / current-value-fancy.rkt
Created March 20, 2018 06:13
Interactive overlays with the Racket Plot Package
#lang racket
(require racket/gui mrlib/snip-canvas plot pict racket/draw)
(define (pie-slice w h angle)
(define nangle (let ((npi (floor (/ angle (* 2 pi)))))
(- angle (* 2 pi npi))))
(define (draw dc dx dy) (send dc draw-arc dx dy w h (- (/ nangle 2)) (/ nangle 2)))
(dc draw w h))
(define item-font (send the-font-list find-or-create-font 12 'default 'normal 'normal))
http://chronos-st.blogspot.com/2007/12/smalltalk-in-one-page.html
http://www.csci.csusb.edu/dick/samples/smalltalk.syntax.html
Formal EBNF Specification of Smalltalk Syntax
1. Character = ? Any Unicode character ?;
2. WhitespaceCharacter = ? Any space, newline or horizontal tab character ?;
3. DecimalDigit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
4. Letter = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M"
| "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"
@swatson555
swatson555 / compile.ss
Created June 22, 2022 13:13
nanopass compiler for r0 language
#!/usr/bin/env scheme --script
(import (nanopass))
(define unique-var
(let ()
(define count 0)
(lambda (name)
(let ([c count])
(set! count (+ count 1))
@soegaard
soegaard / Urlang Counter Example
Created November 9, 2021 21:23
Urlang Counter Example using React
#lang at-exp racket
(require urlang urlang/html urlang/react/urx)
(require net/sendurl syntax/parse)
;;;
;;; Urlang Configuration
;;;
(current-urlang-run? #f) ; run using Node? No, use browser
(current-urlang-echo? #t) ; print generated JavaScript?