Skip to content

Instantly share code, notes, and snippets.

View 0x70b1a5's full-sized avatar
💀
In all thy works remember thy last end, and thou shalt never sin.

0x70b1a5

💀
In all thy works remember thy last end, and thou shalt never sin.
View GitHub Profile
@eglaysher
eglaysher / mandelbrot.hoon
Last active February 23, 2020 20:26
Fixed-point (not floating point!) Mandelbrot generator in Hoon.
:: Mandelbrot implementation inspired by the fixed-point version for
:: uBasic/4tH, and the floating point version for PureBasic from
:: https://rosettacode.org/wiki/Mandelbrot_set. This is pure fixed-point.
::
:: The trick is to use 10.000 as "floating" 1.0, and then do all math in terms
:: of that.
::
|%
++ left-edge -21.000
++ right-edge --15.000
@mattnewport
mattnewport / speakrune.hoon
Last active February 22, 2020 04:25
Convert runes to their spoken form
|= raw=tape
^- tape
=< ?:((valid raw) (turn raw convert) "input contains non-rune characters")
|%
++ valid
|= x=tape
^- ?
=/ chars (sy x)
(~(all in chars) |=(c=@t (~(has by table) c)))
++ convert
@mattnewport
mattnewport / planetppm.hoon
Created August 29, 2019 03:54
Procedural Planet raytracer in Hoon
|= dim=@ud ^- (list @t)
=/ dx (div:rs .1 (sun:rs dim))
=/ white [.1 .1 .1]
=< (genppm dim)
|%
++ min
|= [x=@rs y=@rs] ^- @rs
?: (lth:rs x y) x y
++ max
|= [x=@rs y=@rs] ^- @rs
@cityofwalls
cityofwalls / PathfinderSpellsJSON.txt
Created December 8, 2017 21:49
Pathfinder Spells List Complete - JSON
This file has been truncated, but you can view the full file.
[
{
"duration": "1 round + 1 round per three levels",
"components": "V, S, M (rhubarb leaf and an adder's stomach), F (a dart)",
"saving_throw": "none",
"school": "conjuration",
"spell_level": "sorcerer/wizard 2, magus 2, bloodrager 2",
"name": "Acid Arrow",
"range": "long (400 ft. + 40 ft./level)",
"description": "An arrow of acid springs from your hand and speeds to its target. You must succeed on a ranged touch attack to hit your target. The arrow deals 2d4 points of acid damage with no splash damage. For every three caster levels you possess, the acid, unless neutralized, lasts for another round (to a maximum of 6 additional rounds at 18th level), dealing another 2d4 points of damage in each round.",
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@mywarr
mywarr / AccessDump.py
Last active April 18, 2024 19:14
use mdbtools to convert .mdb to .sqlite and .csv
#!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
# http://sourceforge.net/projects/mdbtools/
import sys, subprocess, os
DATABASE = sys.argv[1]
@mikedamage
mikedamage / morse_code_dictionary.rb
Last active October 20, 2023 20:41
Morse code dictionary as a Ruby Hash object
morse_dict = {
"a" => ".-",
"b" => "-...",
"c" => "-.-.",
"d" => "-..",
"e" => ".",
"f" => "..-.",
"g" => "--.",
"h" => "....",
"i" => "..",