Skip to content

Instantly share code, notes, and snippets.

View fallengiants's full-sized avatar
💭
in Domine sola fidi, et mala omnis acqui vincit.

fall fallengiants

💭
in Domine sola fidi, et mala omnis acqui vincit.
View GitHub Profile
### Keybase proof
I hereby claim:
* I am fallengiants on github.
* I am fallengiants (https://keybase.io/fallengiants) on keybase.
* I have a public key ASCZnAzaOZjuCtgOm6QhAPKB8ugUlm3NzRHmrQwjJAYh_Qo
To claim this, I am signing this object:
* { padding: 0; margin: 0; }
img[alt="zerohedge logo"] {
transform: rotateZ(0.01turn) rotateY(1turn) skewX(5deg) scaleY(2);
}
header ul li {
margin-right: 50px;
text-decoration: none;
}
div.container > div > div > header { background-color: white;}
(alert("Hacked")();
@fallengiants
fallengiants / search.hjson
Created January 18, 2024 20:39
Tracky Search In Vega - just in case i lose it again
{
$schema: https://vega.github.io/schema/vega/v5.json
description: Timeline from CTA to HTTP Out
title: Event Timeline
config: {
autosize: fit
}
data: [
{
name: tracky
@fallengiants
fallengiants / point.rb
Created September 8, 2021 14:42
Point math for finding voronoi edges
class Point
attr_accessor :x, :y
def initialize(x,y)
@x = x.to_f
@y = y.to_f
end
def pointize_args(x_or_point, y = nil)
if x_or_point.is_a?(Point)
@fallengiants
fallengiants / die.rb
Created July 25, 2021 19:24
Die Roller Early
=begin
Dice formats:
xdy: normal die
does pemdas left/right
=end
class Dice
# todo: attr_accessor luck / die rolls with exclusions (4d6-2d) and randlists {1,1,2,3,4}
def initialize; end
@fallengiants
fallengiants / genetic.rb
Created March 15, 2021 21:54
Genetic algorithm
# Genetic algorithm
# Guesses a sequence of numbers. Average distance from the target set is the fitness function.
require 'pp'
LENGTH = 100
MIN_VAL = 0
MAX_VAL = 100
PERFECT_SET = 0.upto(LENGTH-1).to_a
@fallengiants
fallengiants / canvashex.js
Created March 30, 2020 16:41
Hexes in Canvas
const $canvas = document.getElementById('art')
const ctx = $canvas.getContext('2d')
const $dump = document.getElementById('dump')
const debug = (c) => $dump.value = JSON.stringify(c)
const deg2rad = (angle) => angle * Math.PI / -180
class Hex {
constructor (x,y,r=10){
this.r = r
@fallengiants
fallengiants / app.js
Created March 9, 2019 23:19
sample simple
var find = (a) => document.querySelectorAll(a)
var titleNode = find('.content h1')[0]
const onLoad = function(){
initButton()
find('.content p:last-child')[0].classList.add('red')
}
function initButton(e){
var clicked_times = 0
@fallengiants
fallengiants / index.html
Created March 9, 2019 23:19
sample simple
<!doctype html>
<html>
<head>
<title>Page Title</title>
<style>
#header { position: relative; top: 0; left: 0; width: 100%; height: 100px; overflow: hidden;
border: 1px solid black; text-align: center; box-shadow: 5px 5px 10px #aa0;}
#header img { width: 100px; position: absolute; top: 0; left: 0 }
.content h1 { text-align: center; }
.content .red { color: red }