Skip to content

Instantly share code, notes, and snippets.

View spdegabrielle's full-sized avatar

Stephen De Gabrielle spdegabrielle

View GitHub Profile
@spdegabrielle
spdegabrielle / index.html
Created March 21, 2016 13:16 — forked from diethardsteiner/index.html
Simple D3JS Dashboard
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<!--<script type="text/javascript" src="d3/d3.v2.js"></script>-->
<script src="http://d3js.org/d3.v2.js"></script>
<!-- Note: I made good use of the sample code provided by the D3JS community and extended it to fit my needs to create this simple dashboard -->
<style type="text/css">
@amyjko
amyjko / cer.md
Last active December 16, 2020 19:14
@tonyg
tonyg / draw-partly-rounded-shape.rkt
Created June 27, 2016 22:01
Drawing partly-rounded-rectangles using Racket's path support
#lang send-exp racket
(require racket/draw)
(define-syntax-rule (build-path (p) body ...)
(let ((p (new dc-path%)))
body ...
p))
(define (quarter-circle p cx cy quarter radius)

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.

@spdegabrielle
spdegabrielle / solar.rkt
Created May 23, 2017 20:27
solar sim using 2htdp/universe
#lang racket/base
(require 2htdp/universe 2htdp/image lang/posn)
; The gravitational constant G
(define G 6.67428e-11)
; Assumed scale: 100 pixels = 1AU
(define AU (* 149.6e6 1000))
(define SCALE (/ 250 AU))
(struct body (id px py vx vy mass radius color) #:mutable #:transparent) ;Structure of body
#lang scribble/doc
Okay, we've made a package and up loaded. But you know what would be lovely?.
Docs! This tutorial is going to start assuming you have a blank file and now clue where to start. By
the end we will have written the documentation for this line-of-best-fit library <show>.
This is racket land, so of course we have a language for documentation! #lang scribble/doc
@(require scribble/manual
@deeglaze
deeglaze / standard-cat.rkt
Last active July 20, 2019 14:11
working out the definition of Racket's to-be standard-cat
#lang racket
(require pict/color)
(provide
(contract-out
[cat-silhouette
(->i ([width positive?] [height positive?])
(#:left-ear-extent [left-ear-extent (>=/c 0)]
#:left-ear-arc [left-ear-arc (real-in 0 (* 2 pi))]
#:left-ear-angle [left-ear-angle (real-in 0 (* 2 pi))]
@dvanhorn
dvanhorn / tweet.rkt
Last active May 10, 2021 13:18
Tweet from Racket
#lang racket
(provide tweet! (struct-out oauth) current-oauth)
(require (only-in racket/random crypto-random-bytes)
json
net/url
(only-in net/uri-codec [uri-unreserved-encode %])
web-server/stuffers/hmac-sha1
(only-in net/base64 base64-encode))
;; tweet! : String -> JSON
@spdegabrielle
spdegabrielle / draw-partly-rounded-shape.rkt
Created November 29, 2017 18:40 — forked from tonyg/draw-partly-rounded-shape.rkt
Drawing partly-rounded-rectangles using Racket's path support
#lang send-exp racket
(require racket/draw)
(define-syntax-rule (build-path (p) body ...)
(let ((p (new dc-path%)))
body ...
p))
(define (quarter-circle p cx cy quarter radius)