Skip to content

Instantly share code, notes, and snippets.

View lesliev's full-sized avatar

Leslie Viljoen lesliev

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
@lesliev
lesliev / gist:e2679634e1fe6cd53f8fbf852766ba14
Created May 4, 2023 06:38
A poem about Alan Rockefeller written by GPT4
In lands of ancient myths and lore,
A legend walks on earthen floor.
Alan Rockefeller, name so grand,
A mycologist of high demand.
Through forests dense and meadows wide,
He roams the world, no path denied.
With keen eye and gentle touch,
He seeks the fungi's secrets, much.
@lesliev
lesliev / gist:f568451ac12fe5550f0965d1c437806d
Created May 3, 2023 11:48
GPT4: "write a Seinfeld episode in the style of Werner Herzog"
Title: "The Inescapable Apartment"
[INT. JERRY'S APARTMENT - DAY]
Jerry, George, and Elaine are sitting in the apartment, discussing the inevitability of human existence. The room seems to be closing in on them, as if the walls are breathing, much like the Amazonian jungle in Herzog's "Aguirre, the Wrath of God".
JERRY
(philosophically)
You know, life is like a glass of water. We drink from it, but eventually, the glass will be empty. And the thirst, the thirst never goes away.
@lesliev
lesliev / heyo.rb
Created May 14, 2018 00:04
All the heyos
heyo = 'heyo'.scan(/./)
heyo.each do |c1|
(heyo-[c1]).each do |c2|
(heyo-[c1, c2]).each do |c3|
(heyo-[c1, c2, c3]).each do |c4|
puts "#{c1} #{c2} #{c3} #{c4}"
end
end
end
@lesliev
lesliev / heyo.py
Last active May 15, 2018 01:51
All the heyos
heyo = set(['h', 'e', 'y', 'o'])
for c1 in heyo:
for c2 in (heyo - set([c1])):
for c3 in (heyo - set([c1, c2])):
for c4 in (heyo - set([c1, c2, c3])):
print (" ".join([c1, c2, c3, c4]))
@lesliev
lesliev / wires.txt
Created December 11, 2015 02:45
Wires from circuits
wire_a: 956
wire_aa: 221
wire_ab: 1021
wire_ac: 84
wire_ad: 65451
wire_ae: 937
wire_af: 2025
wire_ag: 680
wire_ah: 64855
wire_ai: 1345
@lesliev
lesliev / circuits3.rb
Created December 11, 2015 02:39
Best circuits
#! /usr/bin/env ruby
class Circuit
def initialize(doc)
@doc = doc.split("\n").map(&:strip)
program = create(@doc)
File.open('program.rb', 'w'){|f| f.puts program}
puts
eval(program.join("\n"))
end
@lesliev
lesliev / circuits2.rb
Last active December 10, 2015 23:23
Better circuits
#! /usr/bin/env ruby
class Circuit
def initialize(doc)
@doc = doc.split("\n").map(&:strip)
program = create(@doc)
File.open('program.rb', 'w'){|f| f.puts program}
puts
eval(program.join("\n"))
end
@lesliev
lesliev / circuits.rb
Created December 10, 2015 04:26
Circuits
#! /usr/bin/env ruby
class Circuit
def initialize(doc)
@doc = doc.split("\n").map(&:strip)
program = create(@doc)
eval(program.join("\n"))
end
def create(doc)
@lesliev
lesliev / Static variables in CoffeeScript
Created August 11, 2013 06:13
How do you refer to @tileSize and @tile in the constructor there? They are undefined.
class MapGenerator
@tileSize: 20 # width and height of a tile
# should this be a power of 2 for WebGL TilingSprite?
@tile:
floor: 0 # clear floor that objects can move through
wall: 1 # wall, creating an obstacle
deadspace: -1
constructor: (width, height) ->