Skip to content

Instantly share code, notes, and snippets.

View gypsydave5's full-sized avatar
👨
Growing an Alan Kay Tribute moustache

David Wickes gypsydave5

👨
Growing an Alan Kay Tribute moustache
View GitHub Profile
@gypsydave5
gypsydave5 / TransformStream.class.st
Created October 25, 2021 12:31
Scrappy transform/map/collect stream in Pharo
Class {
#name : #TransformStream,
#superclass : #DecoratorStream,
#instVars : [
'block',
'originalStream'
],
#classInstVars : [
'decoratedStream',
@gypsydave5
gypsydave5 / index.html
Created March 14, 2021 22:24
web components playaround with chess
<html lang="en">
<head>
<title>wc-test</title>
<script>
const squareClickEventName = 'square-click';
const iToFile = (n) => String.fromCharCode(97+n)
const iToRank = (n) => String(n+1)
@gypsydave5
gypsydave5 / fizz-buzz-types.ts
Last active October 19, 2020 21:49
FizzBuzz using the TypeScript type system
// To write FizzBuzz we'll need some numbers. Which means we'll have to define them...
type Z = { type: 'zero' }
type N = Z | S
type S = { prev: N }
type N1 = { prev: Z }
type N2 = { prev: N1 }
type N3 = { prev: N2 }
type N4 = { prev: N3 }
type N5 = { prev: N4 }
type N6 = { prev: N5 }
abstract class Option<A> {
abstract get(): A
abstract getOrElse(a: A): A
abstract map<B>(f: (a: A) => B): Option<B>
static none<A>(): None<A> {
return new None<A>()
}
static some<A>(a: A): Some<A> {
@gypsydave5
gypsydave5 / week_4_exercises.lisp
Created September 6, 2018 13:16
SN - Lisp Club -The output of the week 4 common lisp exercises
(defun add-one-to-it-all (ls)
(let ((result nil))
(dolist (x ls)
(push (1+ x) result))
(reverse result)))
(defun my-length (ls)
(let ((total 0))
(dolist (x ls)
(setf total (+ 1 total)))
desc 'Generate tags page'
task :tags do
puts "Generating tags..."
require 'rubygems'
require 'jekyll'
include Jekyll::Filters
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)
site.read_posts('')
" WordProcessor Mode / Goyo
let g:goyo_width=65
let g:wp_mode_is_on = 0
function! ToggleWPMode()
if g:wp_mode_is_on
set formatoptions=tcq
set nowrap nolinebreak expandtab
silent! nunmap <buffer> k