Skip to content

Instantly share code, notes, and snippets.

Richard Hull rm-hull

Block or report user

Report or block rm-hull

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rm-hull
rm-hull / script.pl
Created Jul 20, 2019 — forked from bessarabov/script.pl
Script to generate data shown in post 'At what time of day does famous programmers work? Part 2. Workweek vs Weekend.' — https://ivan.bessarabov.com/blog/famous-programmers-work-time-part-2-workweek-vs-weekend
View script.pl
#!/usr/bin/perl
# This script is made to show graphs with git commit time made on workweek vs weekend
#
# The desription of this script and results of its usage is avaliable at:
# https://ivan.bessarabov.com/blog/famous-programmers-work-time-part-2-workweek-vs-weekend
#
# usage:
#
# git log --author="Sebastian Riedel" --format="%H %ai" | perl script.pl
@rm-hull
rm-hull / content.md
Created Jan 4, 2017 — forked from ayosec/content.md
Why Lisp macros are cool, a Perl perspective
View content.md
@rm-hull
rm-hull / SSD1331.py
Created Nov 27, 2016 — forked from TheRayTracer/SSD1331.py
The below Python source files control an OLED display (size 96 x 64, 65K colours) using a SSD1331 chipset and the SPI interface. The source code initialises the chipset and includes hardware accelerated functions for drawing primitive shapes and a non-hardware accelerated full ASCII set. Examples include a basic Space Invaders game, and a clock.
View SSD1331.py
import struct
import spidev
import sys
import time
import random
import RPi.GPIO as gpio
ascii = [
[ 0x55, 0x00, 0x55, 0x00, 0x55 ],
[ 0x55, 0x00, 0x55, 0x00, 0x55 ],
View answer.md

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

View introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

View css-parser.md
@rm-hull
rm-hull / sin.cljs
Last active Dec 30, 2015 — forked from martintrojer/sin.cljs
Sample core.async - see it running in the browser: http://programming-enchiladas.destructuring-bind.org/rm-hull/7758795
View sin.cljs
(ns async-test.sinewave.core
(:require [cljs.core.async :refer [<! >! chan timeout]])
(:require-macros
[cljs.core.async.macros :as m :refer [go]]))
(defn sin-vals [offset]
(map #(Math/sin %) (iterate (partial + 0.1) offset)))
(let [events (chan)]
@rm-hull
rm-hull / three.cljs
Last active Apr 11, 2017 — forked from michiakig/three.cljs
Simple demonstration of using THREE.js with ClojureScript [from a fork of https://gist.github.com/spacemanaki/1157978], now working with thanks to @seabre
View three.cljs
(ns three.demo
(:require [THREE :as THREE]))
(def camera
(THREE/PerspectiveCamera.
75
(/ 800 600)
1
10000))
View sudoku.cljs
(ns sudoku
;(:refer-clojure :exclude [==])
(:require-macros [cljs.core.logic.macros :as m])
(:use [cljs.core.logic :only [everyg infd distinctfd]]))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
View curry.clj
(defmacro def-curry-fn [name args & body]
{:pre [(not-any? #{'&} args)]}
(if (empty? args)
`(defn ~name ~args ~@body)
(let [rec-funcs (reduce (fn [l v]
`(letfn [(helper#
([] helper#)
([x#] (let [~v x#] ~l))
([x# & rest#] (let [~v x#]
(apply (helper# x#) rest#))))]
You can’t perform that action at this time.