This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
spammy_recruiters = [] | |
jason_recruiters = [] | |
with open('spammers.txt', 'r') as f: | |
spammers = f.readlines() | |
for domain in spammers: | |
spammy_recruiters.append(domain.replace(' OR \n', '').replace('\n', '')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
while True: | |
reading = accelerometer.get_x() | |
if reading > 20: | |
display.show("R") | |
elif reading < -20: | |
display.show("L") | |
else: | |
display.show("-") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
import random | |
names = [ | |
"Mary", "Yolanda", "Damien", "Alia", | |
"Kushal", "Mei Xiu", "Zoltan"] | |
display.scroll(random.choice(names)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
while True: | |
if button_a.is_pressed(): | |
display.show(Image.HAPPY) | |
elif button_b.is_pressed(): | |
break | |
else: | |
display.show(Image.SAD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import display | |
# This text will scroll on the 5x5 matrix display | |
display.scroll('Hello PyCon Italy') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DontShakeMe - Andrea Grandi (2016) | |
# License: MIT | |
from microbit import display, Image, accelerometer, sleep | |
# display an happy face by default | |
display.show(Image.HAPPY) | |
# if you shake the device, you make microbit sad | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import microbit as m | |
SUN_IMAGE = m.Image( | |
"90909\n" | |
"09990\n" | |
"99999\n" | |
"09990\n" | |
"90909") | |
MOON_IMAGE = m.Image( | |
"99900\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import microbit as m | |
SENSITIVITY = 250 | |
while (True): | |
x = m.accelerometer.get_x() | |
if abs(x) < SENSITIVITY: | |
m.display.show(m.Image.HAPPY) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
server_name andreagrandi.it www.andreagrandi.it; | |
# Redirect all requests to HTTPS. | |
return 301 https://$host$request_uri; | |
} |