Skip to content

Instantly share code, notes, and snippets.

View Steffo99's full-sized avatar

Stefano Pigozzi Steffo99

View GitHub Profile
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<style>
body {
background-color: #ff7f00;
font-family: 'Ubuntu', sans-serif;
@Steffo99
Steffo99 / vacanze.cpp
Last active September 28, 2016 19:24
Homework...
#include <iostream>
using namespace std;
#define ERRORE_TIPO_INESISTENTE -1
#define ERRORE_MANCANO_GIORNI -2
const int TRATTENUTA_MALATTIA = 3;
const int TRATTENUTA_FERIE = 5;
const int GIORNI_MALATTIA = 40;
const int GIORNI_FERIE = 30;
@Steffo99
Steffo99 / centralino.cpp
Last active September 28, 2016 19:54
Homework...
#include <iostream>
using namespace std;
#define CHIAMATE_MASSIME 100
#define NUMERI_MASSIMI 200
struct Numero
{
string cifre;
int frequenza;
@Steffo99
Steffo99 / runall.sh
Created November 21, 2016 07:58
Avvia tutte le applicazioni specificate
#!/bin/bash
if [ $# -lt 1 ]; then
apps="bot hs levels mifia music"
else
apps=$1
fi
result=0
for app in $apps; do
@Steffo99
Steffo99 / byte.cpp
Last active December 1, 2016 11:40
Homework. Again.
#ifndef BYTE_CPP
#define BYTE_CPP
#include <math.h>
#include "byte.h"
Byte::Byte()
{
for(int i = 0; i < 8; i++)
{

Keybase proof

I hereby claim:

  • I am Steffo99 on github.
  • I am steffo (https://keybase.io/steffo) on keybase.
  • I have a public key whose fingerprint is E4C0 D821 C16C C5E3 B339 68ED A2D5 33A3 4120 5E8A

To claim this, I am signing this object:

@Steffo99
Steffo99 / coso.c
Last active February 13, 2017 08:12
l'ennesimo programma con l'msp
#include <msp430.h>
int on = 0;
int period = 1000;
float dutycycle = 0.3f;
void startTimer(int period)
{
TA0CTL = TASSEL__SMCLK | ID__1 | MC__UP | TACLR;
TA0CCR0 = period;
@Steffo99
Steffo99 / semaforocommentato.c
Created January 4, 2017 15:31
Semaforo commentato per MSP430
#include <msp430.h>
/*
P1.0 = LED errore nel programma
P4.1 = pulsantino
P6.0 = LED rosso verticale
P6.1 = LED giallo verticale
P6.3 = LED verde verticale
#!/usr/bin/python3
import requests
from bs4 import BeautifulSoup
for subnet in range(2, 4):
for ip in range(1, 255):
try:
r = requests.get("http://192.168.{}.{}".format(subnet, ip))
except KeyboardInterrupt:
quit()
@Steffo99
Steffo99 / autosfondo.py
Last active February 9, 2017 13:19
Sfondi automatici
from PIL import Image, ImageDraw
import random
i = Image.new('RGB', (1600, 900))
d = ImageDraw.Draw(i)
for y in range(0, 900):
for x in range(0, 1600):
rosso = random.normalvariate(33, 32)
verde = random.normalvariate(33, 32)
blu = random.normalvariate(33, 32)