Skip to content

Instantly share code, notes, and snippets.

View louis-e's full-sized avatar

Louis Erbkamm louis-e

View GitHub Profile
def floodFill(img, sr, sc, new_value):
old_value = img[sr][sc][0]
queue = [(sr, sc)]
seen = set()
tot_rows = img.shape[0]
tot_cols = img.shape[1]
while queue:
nxt = []
for x, y in queue:
if (img[x][y] == new_value):
louis-e / translation.html
Created March 4, 2021 15:22
Website Google Translation implementation
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
</script><script type="text/javascript" src="//"></script>
louis-e / javascript_multi_language.html
Last active August 14, 2020 23:22
HTML JavaScript | Easy Multi Language Support
<!DOCTYPE html>
<p id="text1">Test auf Deutsch!</p>
if (navigator.language != "de-DE" && navigator.language != "de" && window.location.hash != "#eng")
window.location.href = "#eng";
louis-e / GridMesh.cs
Last active June 22, 2020 21:42 — forked from mdomrach/GridMesh.cs
Fixed line 17; otherwise the top and the right side of the grid won't be closed
using UnityEngine;
using System.Collections.Generic;
public class GridMesh : MonoBehaviour
public int GridSize;
void Awake()
louis-e / GridSnapping.cs
Last active September 3, 2020 09:37
GridSnapping.cs | GameObject Editor Grid Snapping (Optional: change the float gridSize to set the size of the grid)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GridSnapping : MonoBehaviour
public GameObject target;
Vector3 gridPos;
public float gridSize = 10f;
louis-e / UnityApplication.systemLanguageHindiFix.cs
Created May 23, 2020 12:38
Because in Unity/C# UnityApplication.systemLanguage doesn't support Hindi, you can use this C# code snippet to recognize a Hindi system language
//NOTE: This only works for Android
using (AndroidJavaClass cls = new AndroidJavaClass("java.util.Locale"))
using (AndroidJavaObject locale = cls.CallStatic<AndroidJavaObject>("getDefault"))
if (locale.Call<string>("getDisplayLanguage") == "हिन्दी")
louis-e /
Last active August 18, 2019 15:34
A python script to protect raspberry pi against overheating because of omxplayer.
import os
import time
def measure_temp():
temp = os.popen("vcgencmd measure_temp").readline()
return (temp.replace("temp=","").replace("'C",""))
while True:
temp = measure_temp()
louis-e /
Created August 15, 2019 15:13
Simple bash script to play youtube video with omxplayer and youtube-dl
#Move this file into /usr/local/bin and add execute permission (sudo chmod +x
#Run it like this: ./
omxplayer -o hdmi $(youtube-dl -g "$1")
louis-e / innovative_try_catch.js
Created July 24, 2019 14:46
JavaScript Try-Catch Stackoverflow
try {
} catch(e) {
window.location.href =
"[js] + "
+ e.message;
louis-e / UDPSocket.cs
Last active May 26, 2024 13:39 — forked from darkguy2008/UDPSocket.cs
Simple C# UDP server/client in 62 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
public class UDPSocket
public Socket _socket;