Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Moll QuantumFractal

View GitHub Profile
@QuantumFractal
QuantumFractal / weather_bot.py
Created February 4, 2023 18:54
Tom's First Python Script
View weather_bot.py
#Twitter Bot Cronjob
#Using the python-twitter API
#[tm]
#
#Debug flag
debug_FLAG = False
#Import the Twitter API, Weather API, and time module
import twitter
import pywapi
import time, string
@QuantumFractal
QuantumFractal / pokemon.go
Created July 20, 2021 03:16
bruteforce dispatch
View pokemon.go
package main
import (
"fmt"
"reflect"
)
const NORMALLY_EFFECTIVE = "it's normally effective"
const SUPER_EFFECTIVE = "it's SUPER effective!"
const NOT_VERY_EFFECTIVE = "it's not very effective..."
View also_impossible.go
package main
import (
"fmt"
"reflect"
)
const NORMALLY_EFFECTIVE = 1.0
const SUPER_EFFECTIVE = 2.0
const NOT_VERY_EFFECTIVE = 0.5
@QuantumFractal
QuantumFractal / idk.jl
Created May 2, 2021 00:41
Julia2Verilog.jl
View idk.jl
using Cassette
Cassette.@context VCtx
mutable struct VMeta
module_name::String
f::IOStream
end
VMeta(module_name::String) = VMeta(module_name, open(module_name * ".v", "w"))
View attraction_mat.jl
function attraction_table(n)
table = zeros(n,n)
attr_norm = Normal(1.0, 0.25)
repl_norm = Normal(-1.0, 0.5)
for index in CartesianIndices(table)
if index[1] == index[2]
table[index] = rand(attr_norm, 1)[1]
else
table[index] = rand(repl_norm, 1)[1]
@QuantumFractal
QuantumFractal / aoc_1.jl
Created December 26, 2020 03:46
aoc_1.jl
View aoc_1.jl
using IterTools
aoc_1_input = """1732
1972
1822
1920
1847
1718
1827
1973
@QuantumFractal
QuantumFractal / keybase.md
Created December 7, 2020 04:59
keybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am QuantumFractal on github.
  • I am tmoll_ (https://keybase.io/tmoll_) on keybase.
  • I have a public key whose fingerprint is EB8B F9AD 3B82 237F FDFA FEAC 9BA1 C9B0 DB10 2926

To claim this, I am signing this object:

View stupid_simple_conv_kernel.jl
function gauss(A, i, j, ui, uj)
nw, n, ne = 1.0f0/9.0f0, 1.0f0/9.0f0, 1.0f0/9.0f0
w, c, e = 1.0f0/9.0f0, 1.0f0/9.0f0, 1.0f0/9.0f0
sw, s, se = 1.0f0/9.0f0, 1.0f0/9.0f0, 1.0f0/9.0f0
top , bottom = j - 1, uj - j
left, right = i - 1, ui - i
nw *= clamp(top * left, 0, 1)
n *= clamp(top, 0, 1)
@QuantumFractal
QuantumFractal / scott.ipynb
Created February 20, 2020 02:46
notebook-grey-scot.ipynb
View scott.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View svg_EBNF
svg_grammar = '''
start : prolog element
prolog: "<?xml" S? attr+ "?>" WS?
element: inline_tag | start_tag element end_tag
start_tag : S? "<" name S? attr+ ">" WS+
end_tag : S? "</" name S? ">" WS+