Skip to content

Instantly share code, notes, and snippets.

View SheatNoisette's full-sized avatar
🖥️
Beep boop

SheatNoisette

🖥️
Beep boop
View GitHub Profile
@SheatNoisette
SheatNoisette / pzr.py
Last active March 28, 2019 14:59 — forked from ColtonPhillips/pzr.py
Small refactoring and added simple CLI
from PIL import Image
import sys
def addUnique(l,item):
if item not in l:
l.append(item)
return l
def convertImage(image):
@SheatNoisette
SheatNoisette / StringIterator.hx
Created June 13, 2019 10:23
Simple string iterator in Haxe
//Simple string iterator for 'for' loops
//Based on the work by Mark Knol, modifed by SheatNoisette.
//https://github.com/HaxeFoundation/code-cookbook
//Creative Common By Attribution 4.0
class StringIterator {
var input:String;
var step:Int;
var index:Int;
@SheatNoisette
SheatNoisette / char_detect.py
Last active October 31, 2019 17:07
Naive characters detection in a 2D array
#!/usr/bin/env python
import os
# Find characters in a 2D array and return their position in the grid
# Basis for a simple optical recognition software
# MIT License
char_array = [
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,1,1,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0],
@SheatNoisette
SheatNoisette / alpha_insert.py
Last active October 31, 2019 17:07
Insert a letter in alphabetical order in a list
#!/usr/bin/env python
# BASIC ALGORITHM
# Insert letter alphabetically in a list
# This quick and dirty example shows how to insert a letter in a list
# alphabetically
# CC-O for homework/class and Beerware Licence for other
test_1 = ["a", "b", "d", "e", "f"]
test_2 = ["i"]
@SheatNoisette
SheatNoisette / GraphvizRenderExample.py
Last active November 23, 2019 17:26
Generate and export graph from dot file using Graphviz
"""
Render Graphviz dot file example
Ubuntu and Debian: sudo apt-get install graphviz && pip3 install graphviz
"""
from graphviz import Source
input_graph = """
graph {
0 [label = "ape"]
1 [label = "apt"]
@SheatNoisette
SheatNoisette / PPMViewerGimp.py
Created November 28, 2019 21:51
Simple B&W PPM Viewer in terminal
# /bin/python3
# Terminal PPM preview loader Quick'n'Dirty
# Print to terminal a preview of a PPM file in black and white generated by gimp
# Like:
# 100
# 010
# 001
# Usage: script.py <ppm file>
import sys
@SheatNoisette
SheatNoisette / gameboy.glsl
Last active June 5, 2020 13:04
Gameboy shader made in shadertoy
// Simple GameBoy style shader in ShaderToy
// This require a texture/Webcam input on Channel0 in ShaderToy
// SheatNoisette (2020) - GNU GPL 3.0 Licensed
vec3 gameboy_palette[4];
vec3 gameboyify(vec3 color) {
// Create palette
gameboy_palette[0] = vec3(51, 44, 80);
gameboy_palette[1] = vec3(70, 135, 143);
@SheatNoisette
SheatNoisette / emsdk.patch
Created December 7, 2021 19:14
Patch to force Emscripten SDK tool downloader to use IPv4 by default
diff --git a/emsdk.py b/emsdk.py
index 9bf7c9c..52d146d 100644
--- a/emsdk.py
+++ b/emsdk.py
@@ -4,8 +4,18 @@
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
+
from __future__ import print_function
@SheatNoisette
SheatNoisette / thinkfan.conf
Created April 1, 2022 08:46
Simple Thinkfan configuration for E480 Thinkpad
sensors:
- tpacpi: /proc/acpi/ibm/thermal
fans:
- tpacpi: /proc/acpi/ibm/fan
# Simple mode: each entry is a [FANSPEED, LOWER_LIMIT, UPPER_LIMIT] tuple.
levels:
- [0, 0, 41]
- [1, 38, 51]
- [2, 45, 56]
@SheatNoisette
SheatNoisette / TechTips.md
Created May 12, 2022 22:53
NVIDIA kernel module missing. Falling back to nouveau. Fedora 36 upgrade

How to fix "NVIDIA kernel module missing. Falling back to nouveau." when upgrading from Fedora 35 to 36:

# Remove every kmod-nvidia from your system
sudo dnf remove kmod-nvidia-5.17.*
sudo dnf reinstall akmod-nvidia
sudo akmods --force

Then Reboot