Skip to content

Instantly share code, notes, and snippets.

View Steffo99's full-sized avatar

Stefano Pigozzi Steffo99

View GitHub Profile
import json
import wordcloud
file = open("data/result.json", encoding="utf8")
j = json.load(file)
for chat in j["chats"]["list"]:
msg_counts = dict()
for message in chat["messages"]:
if "from" not in message:
@Steffo99
Steffo99 / unimore_connect.sh
Last active November 12, 2018 08:22
Login Unimore
#!/bin/zsh
killall dhcpcd
ip link set wlp10s0 up
iw dev wlp10s0 connect 'UNIMORE'
dhcpcd wlp10s0
if [ $? -ne 0 ]; then
echo "\033[1;31mConnessione fallita: non รจ stato ottenuto un indirizzo IP valido."
exit 1
fi
python utils_autologin_unimore.py
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Steffo99
Steffo99 / aoc3.rs
Last active December 5, 2018 14:48
extern crate regex;
#[macro_use] extern crate lazy_static;
struct Claim {
i: usize,
x: usize,
y: usize,
l: usize,
h: usize
}
@Steffo99
Steffo99 / vvvvvv_music_unpacker.py
Last active December 14, 2018 16:01 — forked from lukegb/vvvvvv_music_unpacker.py
Unpack music from VVVVVV's music file! py3 edition
f = open("vvvvvvmusic.vvv", 'rb')
q = f.read()
FILE_NAMES = ['0levelcomplete.ogg','1pushingonwards.ogg','2positiveforce.ogg','3potentialforanything.ogg','4passionforexploring.ogg','5intermission.ogg','6presentingvvvvvv.ogg','7gamecomplete.ogg','8predestinedfate.ogg','9positiveforcereversed.ogg','10popularpotpourri.ogg','11pipedream.ogg','12pressurecooker.ogg','13pacedenergy.ogg','14piercingthesky.ogg']
startAt = endAt = -1
musStartAt = musEndAt = -1
currentMus = 0
while True:
oldStartAt = startAt
import json
import os
import re
DATA_FOLDER = "T:\\Data Takeout"
REGEX = r""
def search_inside(loaded_chat):
for msg in loaded_chat["messages"]:
match = re.search(REGEX, msg.get("content", ""), re.IGNORECASE)
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
#!/bin/bash
MAX_BRIGHTNESS=$(cat /sys/class/backlight/nvidia_0/max_brightness)
if [[ $1 -lt 0 ]]; then
echo "Error: brightness must be in range [0-$MAX_BRIGHTNESS]"
exit 1
elif [[ $1 -gt $MAX_BRIGHTNESS ]]; then
echo "Error: brightness must be in range [0-$MAX_BRIGHTNESS]"
exit 2
fi
echo $1 > /sys/class/backlight/nvidia_0/brightness
@Steffo99
Steffo99 / argc_argv.cpp
Created June 19, 2019 14:55
Come funzionano argc e argv
#include <iostream>
int main(int argc, char *argv[]) {
/* argc รจ il numero di parametri passati
* argv รจ un array di stringhe lungo [argc] contenente i parametri passati
*
* Il primo parametro passato รจ sempre il nome del file.
*
* ./a.exe uno due tre
* argv[0] = "./a.exe"
@Steffo99
Steffo99 / sorteggio.py
Created December 26, 2019 13:23
Un urrร  per la trasparenza!
#!/usr/bin/python3.8
import random
# Seed cortesemente fornito da Kappa
random.seed("Penis")
sonic_mania = random.sample([
"Kappa",
"Kappa",
"Kappa",