Skip to content

Instantly share code, notes, and snippets.

View lemonad's full-sized avatar

Jonas Nockert lemonad

View GitHub Profile
@lemonad
lemonad / corrugated-sheet-metal.ipynb
Created April 19, 2020 20:10
Corrugated sheet metal
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lemonad
lemonad / corrugated-sheet-metal.ipynb
Last active April 19, 2020 19:59
Corrugated sheet metal
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lemonad
lemonad / example-of-accidental-correlation.ipynb
Last active March 31, 2020 10:07
Example of accidental correlation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lemonad
lemonad / gist:f88887a1d12a4bdc74e6677f395d27c8
Created March 4, 2020 23:11
Function instead of class with closure?
def S(x):
def printx():
print(x)
def times_x(multiplier):
return multiplier * x
def change_x(new_x):
nonlocal x
x = new_x
@lemonad
lemonad / ob_size.py
Created February 18, 2020 13:16
Ob_size is set negative for negative integers
import ctypes
class IntStruct(ctypes.Structure):
_fields_ = [("ob_refcnt", ctypes.c_long),
("ob_type", ctypes.c_void_p),
("ob_size", ctypes.c_ulong),
("ob_digit", ctypes.c_long)]
def __repr__(self):
return ("IntStruct(ob_digit={self.ob_digit}, "
"refcount={self.ob_refcnt})").format(self=self)
@lemonad
lemonad / main.lua
Created August 31, 2019 15:22
Love2D shader for waves (very much WIP)
local WIDTH = 800
local HEIGHT = 600
local shader_code = [[
extern vec2 screen_dims;
extern number time;
number pi = atan(1.0) * 4.0;
vec4 effect(vec4 color, Image image, vec2 uvs, vec2 screen_coords) {
vec2 screen_coords_norm = vec2(
@lemonad
lemonad / monte_carlo_mandelbrot_area.py
Last active May 18, 2019 21:20
Mandelbrot fractal area approximation by Monte Carlo sampling
"""
Approximates area of Mandelbrot fractal by Monte Carlo sampling.
The definition of the Mandelbrot Set is the set of values c \in C where
z_{n+1} = z_n^2 + c
remains bounded. Most members will be within (-2, 2) x (-2i, 2i) so
here this is used as an artificial bounds to simplify the approximation.
Verifying that +lemonad is my blockchain ID. https://onename.com/lemonad
@lemonad
lemonad / keybase.md
Created October 24, 2014 21:03
Keybase

Keybase proof

I hereby claim:

  • I am lemonad on github.
  • I am lemonad (https://keybase.io/lemonad) on keybase.
  • I have a public key whose fingerprint is 975E 649F C19F BFF6 3930 CB08 EADA 56A2 FA66 9948

To claim this, I am signing this object:

@lemonad
lemonad / gist:3677353
Created September 8, 2012 17:15
package.json
{
"name": "hawfin.ch",
"author": "Jonas Nockert <jonasnockert@gmail.com>",
"description": "It's crunch time!",
"version": "0.0.1-225",
"dependencies": {
"async": "0.1.22",
"cookie": "0.0.4",
"gravatar": "1.0.6",
"imagemagick": "0.1.2",