Skip to content

Instantly share code, notes, and snippets.

View Ge-lx's full-sized avatar

Falk Ebert Ge-lx

View GitHub Profile
@Ge-lx
Ge-lx / tdma.py
Created May 28, 2020 21:43
Tridiagonal Matrix Algorithm - Python solver
# Solves the matrix equation A x = d and returns the solution x
def tridiagonal_thomas (A, d):
A = np.copy(A)
d = np.copy(d)
n = len(d)
# Gaussian elimination of lower diagonal
for i in range(1, n):
s = A[i, i-1] / A[i-1, i-1]
A[i, i] = A[i, i] - s*A[i-1, i]
@Ge-lx
Ge-lx / skribbl.io.chat.js
Created April 15, 2020 12:18
Paste this into the browser console (F12) to move the chat to a better position
(function (chatStyle) {
var sidebar = document.querySelector('#containerSidebar');
sidebar.style.position = 'absolute';
sidebar.style.bottom = 0;
sidebar.style.width = '100%';
sidebar.style.height = '300px';
var adsContainer = document.querySelector('#containerFreespace');
adsContainer.style.display = 'none';
}());
@Ge-lx
Ge-lx / find_jquery_handlers.js
Last active March 27, 2020 16:43
DevTools snippet to properly debug jQuery event listeners
function findHandlers (element, eventType, groupBySelector = false) {
function stringForElement (e) {
if (e === document) {
return 'document'
};
return e.nodeName.toLowerCase() + '.' + Array.from(e.classList).join('.');
}
function getAllHandlers () {
const handlers = {};
@Ge-lx
Ge-lx / rooms.cc
Last active December 14, 2017 14:17
#include <iostream>
using namespace std;
class Room {
public:
Room (string n, unsigned short times) {name = n; allowedEntries = times; North = this; South = this; East = this; West = this;};
unsigned short allowedEntries;
string name;
Room *North, *South, *East, *West;
#!/bin/sh
#Hier werden einige Variablen definiert, um Änderungen leichter zu ermöglichen
IPTABLES="iptables"
INET_IFACE="eth0"
LAN_IFACE="wlan0"
LO_IFACE="lo"
LAN_IP="192.168.0.1"
LO_IP="127.0.0.1"
#!/bin/sh
#Hier werden einige Variablen definiert, um Änderungen leichter zu ermöglichen
IPTABLES="iptables"
INET_IFACE="eth0"
LAN_IFACE="wlan0"
LO_IFACE="lo"
LAN_IP="192.168.0.1"
LO_IP="127.0.0.1"
@Ge-lx
Ge-lx / Test.java
Created November 12, 2014 14:12
ProtocolLib test
package test;
import io.github.gelx_.protocollib.ProtocolConnection;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
/**
* Created by Gelx on 12.11.2014.