I hereby claim:
- I am andreagrandi on github.
- I am andreagrandi (https://keybase.io/andreagrandi) on keybase.
- I have a public key ASClZLE2JRXY3NdFfmpwO-4yEwrmRL45_zVUR6heAwiKWgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
- create andreagrandi.it repository on GitHub | |
- clone andreagrandi.it repository locally | |
- copy files from andreagrandi.co.uk repository to andreagrandi.it one | |
- change extras/CNAME content to: www.andreagrandi.it | |
- change SITEURL in publishconf.py to: https://www.andreagrandi.it | |
- change DISQUS_SITENAME to ‘andrea-grandi-it’ | |
- get a new GitHub token from https://github.com/settings/tokens | |
- activate TravisCI for repository andreagrandi.it | |
- run travis encrypt GH_TOKEN=……… from inside andreagrandi.it repository | |
- copy the generated value to .travis.yml |
from microbit import * | |
image_1 = Image.XMAS | |
image_2 = Image.HAPPY | |
status = 'OFF' | |
while True: | |
if button_a.is_pressed(): | |
status = 'ON' |
from rest_framework.permissions import BasePermission, SAFE_METHODS | |
class IsAdminOrReadOnly(BasePermission): | |
def has_permission(self, request, view): | |
if request.method in SAFE_METHODS: | |
return True | |
else: | |
return request.user.is_staff |
#!/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', '')) |
from microbit import * | |
while True: | |
reading = accelerometer.get_x() | |
if reading > 20: | |
display.show("R") | |
elif reading < -20: | |
display.show("L") | |
else: | |
display.show("-") |
from microbit import * | |
import random | |
names = [ | |
"Mary", "Yolanda", "Damien", "Alia", | |
"Kushal", "Mei Xiu", "Zoltan"] | |
display.scroll(random.choice(names)) |
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) |
from microbit import display | |
# This text will scroll on the 5x5 matrix display | |
display.scroll('Hello PyCon Italy') |