Skip to content

Instantly share code, notes, and snippets.

View lefuturiste's full-sized avatar
📜
A lot of things going on at the same time!

Le_Futuriste lefuturiste

📜
A lot of things going on at the same time!
View GitHub Profile
#!/bin/python3
from i3ipc import Connection, Event
import subprocess
log = print
"""
Small python utility intended to help me in various ways
The goal is to listen, capture and sink keyboard inputs (no input are sent to the windows), no x11 windows should be created.
We listen for key press in true vim fashion and do things depending.
@lefuturiste
lefuturiste / around.sh
Created August 4, 2022 11:15
POSIX Script to get adjacent lines
#!/bin/sh
# meant to be POSIX compliant
full_usage() {
echo "Usage: around [OPTION]... [FILE] LINE_NUMBER"
echo "Output lines adjacents to one particular line in a file"
echo ""
echo "Options:"
@lefuturiste
lefuturiste / example_file_to_import_poolzor.csv
Created April 4, 2022 12:36
Simple example of a CSV file to import in poolzor live
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Poolzor Live;Event name:;Test
Teams (below).;;;;;Additional columns (optional) =>
Reg. ID;Name;Country (xx);Comments;Booth (if defined);Arrived (0/1);city
100;We Robot;fr;N'importe quoi;20;1;Aubevoye
101;INSA;fr;N'importe quoi;30;1;Paris
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Voronoi Diagram with GPU</title>
</head>
<body>
<div>
@lefuturiste
lefuturiste / 0_prefix_tree.py
Created December 3, 2021 21:23
Example of a prefix tree implementation in python
import fileinput
def load_from_stdin():
inp = fileinput.input()
words = []
for line in inp:
word = line.strip()
# non case sensitive
words.append(word.lower())
return words
let sommets_exemple = [0;1;2;3;4;5;6;7;8;9] ;;
let arcs_exemple = [(0,1);(1,3);(0,2);(2,3);(3,5);(3,4);(4,2);(4,7);(6,4);(6,7);(7,8);(7,9);(8,9)] ;;
type graphe_1 = bool array array ;;
type graphe_2 = int list array ;;
(* 1.1 *)
let construction_1 sommets arcs =
let n = (List.length sommets) in
import matplotlib.pyplot as plt
import math
import random
import pprint
import json
import jsbeautifier
def generate_points(n=100):
X = []
Y = []
sdfjsdfsfjjssfd
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#define MEMORY_SIZE 25
#define MAX_LOOPS 5000
#define MAX_INSTRUCTIONS 10000
#define MAX_INPUT 256
#define MAX_EXECUTION_STEPS 100000
<?xml version="1.0" encoding="utf-8"?>
<circuit>
<version>1</version>
<attributes/>
<visualElements>
<visualElement>
<elementName>ROM</elementName>
<elementAttributes>
<entry>
<string>AddrBits</string>