Skip to content

Instantly share code, notes, and snippets.

View hashalon's full-sized avatar
🌧️

hashalon hashalon

🌧️
  • Belgium / France
View GitHub Profile
@eevee
eevee / perlin.py
Last active May 29, 2025 13:08
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
interpolating.
@elliotchance
elliotchance / brainfuck.py
Created January 19, 2016 11:52
Write Your Own Brainfuck Compiler
import sys
import ply.yacc as yacc
import ply.lex as lex
tokens = (
'INCREMENT',
'DECREMENT',
'SHIFT_LEFT',
'SHIFT_RIGHT',
'OUTPUT',
<?xml version="1.0" encoding="UTF-8"?>
<!--
File based about the file "sh.lang" present in GtkSourceView
Author: Nicola Jelmorini <jelmorini@protonmail.ch>
Copyright (C) 2014 Nicola Jelmorini <jelmorini@protonmail.ch>
This file is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@jefftrull
jefftrull / main.cpp
Created October 22, 2011 02:00
Example of embedding Ruby interpreter into C/C++ program
// very basic embedded Ruby interpreter for C++ programs
// thrown together by Jeff Trull <jetrull@sbcglobal.net> based on googling and asking questions on #ruby-lang
#include <ruby.h>
// access to C variables
static VALUE getter(VALUE ns, VALUE var) {
return Qfalse;
}
VALUE setter(VALUE ns, VALUE var, VALUE val) {