Skip to content

Instantly share code, notes, and snippets.

View edomora97's full-sized avatar
🥄
Working hard!

Edoardo Morassutto edomora97

🥄
Working hard!
View GitHub Profile
@edomora97
edomora97 / input.txt
Last active August 29, 2015 14:05
C++ Fast file reader
16
1
2 3
4 5 6
7
8 9
10 11
12
13 14 15
1234567890
@edomora97
edomora97 / FastIO.cpp
Last active August 29, 2015 14:05
File reader
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
class FileReader {
private:
FileReader(const FileReader&fr){}
int maxBufferSize,bufferSize,bufferPointer;int fileNo;char*buffer;
void loadBuffer(){bufferSize=read(fileNo,buffer,maxBufferSize);bufferPointer=0;}
inline char nextChar(){if(bufferPointer>=bufferSize)loadBuffer();return buffer[bufferPointer++];}
@edomora97
edomora97 / rainbow.py
Created January 3, 2015 16:50
rainbow
import math
import subprocess
def clamp(x, minimum, maximum):
return max(minimum, min(x, maximum))
def gaussian (w, x):
return (w**-0.5) * math.exp(-(x/2*w)**2)
def wl2rgb (wl, f = 0.02):
mult = 255 / gaussian(f, 0)
r = mult * gaussian(f, wl-660)
@edomora97
edomora97 / new_version.js
Last active September 13, 2018 20:30
Facebook friends affinity
var b=document.querySelector("img[id^='profile_pic_header_']").id.substr(19),c;c=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");c.onreadystatechange=function(){if(4==c.readyState&&200==c.status){var a=c.responseText,a=a.substr(9),a=JSON.parse(a).payload.entries;console.log(a);document.body.innerHTML="";document.write("<title>Affinit\u00e0 con i tuoi amici</title><link rel='stylesheet' type='text/css' href='https://fonts.googleapis.com/css?family=Rancho&effect=shadow-multiple'><style>a{text-decoration:none;color:#333;}a:hover,a:focus{text-decoration:underline;}a:visited{color:#333;}img{height:25px;border-radius:25px;border:2px solid;float:left;margin-right:5px}table{cursor:default;margin:20px;background:#e9e9e9;font-family:'Rancho';font-size:25px;}th{border-bottom:1px solid white;background:#e0e0e0;}th,td{border-left:1px solid white;border-right:1px solid white;}tr{transition:all .4s;}td,th{transition:all .4s;padding:0;}th{padding:10px;}tr:hover,tr:focus{background:rgba(255, 25
@edomora97
edomora97 / style.css
Last active August 29, 2015 14:13
Facebook affinity stylesheet
@import url(https://fonts.googleapis.com/css?family=Rancho&effect=shadow-multiple);
a {
color: #333;
text-decoration: none;
}
a:hover,a:focus {
text-decoration: underline;
}
a:visited {
color: #333;
@edomora97
edomora97 / .zshrc
Last active October 20, 2015 12:15
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
ZSH_THEME="lukerandall"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
#!/bin/sh
UPGRADE_SYSTEM=yes
INSTALL_SOFTWARE=yes
INSTALL_MATE=yes
INSTALL_KEEPASS2=yes
INSTALL_CHROME=yes
INSTALL_DROPBOX=yes
INSTALL_SPOTIFY=yes
INSTALL_OH_MY_ZSH=yes
@edomora97
edomora97 / README.md
Last active August 27, 2023 19:26
Minecraft Launcher

Minecraft Offline Client Launcher

This script downloads from Mojang servers and runs the specified Minecraft version. It supports only offline (i.e. not online-verified) mode.

Usage

You have to have java, python3 and the python request library installed.

Run it like ./client_launcher.py 1.15.2 username

@edomora97
edomora97 / keybase.md
Created August 17, 2020 11:33
keybase.md

Keybase proof

I hereby claim:

  • I am edomora97 on github.
  • I am edomora97 (https://keybase.io/edomora97) on keybase.
  • I have a public key whose fingerprint is 14F3 C390 C274 A2BC 668B 3B32 FF05 4151 02A6 81A7

To claim this, I am signing this object: