Skip to content

Instantly share code, notes, and snippets.

View gruvw's full-sized avatar
💻
Coding as always

Lucas Jung gruvw

💻
Coding as always
View GitHub Profile
{
"basics": {
"name": "Lucas Jung",
"label": "EPFL Computer Science Student / Software Developer",
"picture": "https://avatars1.githubusercontent.com/u/63407038?s=460&u=58879e919dd2613767be454455528db0e469f89b&v=4",
"email": "[email protected]",
"website": "https://gruvw.com",
"summary": "Also known as Gruvw, I was born in 2002 in Switzerland. I started to learn how to code at the age of 10. Since then, I have fallen in love with programming and Computer Science in general. I learned a lot about programming by myself before studying Computer Science at EPFL and I wrote many projects (some OpenSource that you can check out on my GitHub). I try to have as much professional experiences as possible in order to develop my skills further and to better understand professional environments. I am passionate and very curious about everything, never missing out an opportunity to learn.",
"location": {
"countryCode": "Switzerland",
@gruvw
gruvw / best_meeting_point.py
Created May 27, 2021 10:28
Meeting point from GPS coordinates
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
multi = 1e3 # Precision
# GPS coords: (°N, °E)
pers = [
(, ),
(, ),
@gruvw
gruvw / .hyper.js
Last active January 9, 2022 10:15
Hyper Terminal Settings
// ~/.hyper.js
"use strict"
module.exports = {
config: {
updateChannel: 'stable',
fontSize: 13,
fontFamily: '"Fira Code", monospace',
fontWeight: 'normal',
fontWeightBold: 'bold',
@gruvw
gruvw / decipher_vigenere.py
Last active March 24, 2022 16:25
Decipher Vigenère from partial plaintext
# Alphabet
a = "abcdefghijklmnopqrstuvwxyz"
# Given data
cipher = "ebgrycxgbghitursyneavcgbgryv"
partial_text = "t*****************u**i**i***" # supposed valid and not empty (only *)
# Function (single char) that does C,T -> K or C,K -> T
clear = lambda c, tk: (i := (a.find(c)-a.find(tk)) % len(a), a[i]) # (index, letter)
@gruvw
gruvw / lexoRank.py
Last active August 3, 2022 09:48
LexoRank Python
import math
def _pad(s, n):
p = _alphabet[0] * (n - len(s))
return s + p
def _debase(s):
val = 0
def max_from(l, s=0):
return max((s := s + e, i) for i, e in enumerate(l))
def max_crossing(l1, l2):
s1, i = max_from(reversed(l1))
s2, j = max_from(iter(l2))
return s1 + s2, (i, len(l1) + j)
@gruvw
gruvw / fix_submission.py
Created January 7, 2024 11:29
Fix MP2 submission
import os
import sys
import glob
def main():
if len(sys.argv) < 2:
print("Usage: python fix_submission.py <SCIPER1-SCIPER2>")
sys.exit(1)
PROJECT = sys.argv[1]
@gruvw
gruvw / merge_riverpod_providers.dart
Created September 13, 2024 06:31
Dart Riverpod: merging two providers of the same type to emit the latest value
import 'package:riverpod/riverpod.dart';
/// Dart Riverpod merging two providers of the same type
/// https://stackoverflow.com/questions/78978863/dart-riverpod-merging-two-providers-of-the-same-type
// Example StateNotifier for a simple counter.
class Counter extends Notifier<int> {
@override
int build() => 0;
void increment() => state++;
@gruvw
gruvw / SSH over USB on a Raspberry Pi.md
Created March 21, 2025 09:06 — forked from etoxin/SSH over USB on a Raspberry Pi.md
SSH over USB on a Raspberry Pi

Our long term goal will be to use SSH over USB. This means that we have to configure Raspbian to treat the USB port like an ethernet port. Mount the micro SD card in a computer (not Pi Zero) and open it with Finder, or Windows Explorer, or whatever it is that you use.

The first thing that you want to do is open a file at the root of the mounted drive called config.txt. In this file you want to add the following line at the very bottom:

dtoverlay=dwc2

The above line will set us up for the next file that we alter. The next file we alter is cmdline.txt, but it is a bit different. Parameters in this file are not delimited by new lines or commas, they are delimited by space characters. In this file we want to add the following: