This file contains hidden or 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/env python3 | |
# Simple multi-processing web crawler, following all a.href's that end in a '/'. | |
import os | |
import traceback | |
from itertools import chain | |
from multiprocessing import Pool | |
from time import time | |
from urllib.parse import urljoin | |
from bs4 import BeautifulSoup |
This file contains hidden or 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
In [1]: import xmltodict | |
In [14]: print(data) | |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<server> | |
<response> | |
<status>ok</status> | |
<actions> | |
<action> | |
<subsystem>hourChooser</subsystem> |
This file contains hidden or 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/env python3 | |
import argparse | |
import os | |
import subprocess | |
# install deps: | |
# $ pip install requests mercurial | |
import requests | |
# Create an OAuth Consumer with Account and Repository Read permission: |
This file contains hidden or 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/env python3 | |
import argparse | |
import sys | |
from PIL import Image | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser( | |
sys.argv[0], description='Convert image to binary.') | |
parser.add_argument('file', type=argparse.FileType('rb')) |
This file contains hidden or 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/env python3 | |
# | |
# Code accompanying https://www.youtube.com/watch?v=SnPh4zwQkVI | |
import atexit | |
from time import sleep | |
from gpiozero import DigitalOutputDevice | |
def _pulse(pin): | |
pin.value = 1 |
This file contains hidden or 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
# The code accompanying https://www.youtube.com/watch?v=PsVcLdAyAcU | |
import atexit | |
import time | |
from gpiozero import LEDBoard | |
leds = LEDBoard(2, 3, 4, 17, 27, 22, 10, 9) | |
i = 0 | |
atexit.register(leds.close) |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am erikvanzijst on github. | |
* I am erikvanzijst (https://keybase.io/erikvanzijst) on keybase. | |
* I have a public key whose fingerprint is E96D DAAB 1680 4D86 EFA2 A08A 4539 ACC7 B26D 1005 | |
To claim this, I am signing this object: |
This file contains hidden or 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
$ # initiate export, will return 202: | |
$ curl -u evzijst:passwd -X POST -v https://api.bitbucket.org/1.0/repositories/evzijst/interruptingcow/issues/export | |
[...] | |
< HTTP/1.1 202 ACCEPTED | |
[...] | |
$ # poll for status updates: | |
$ curl -u evzijst:passwd -X GET https://api.bitbucket.org/1.0/repositories/evzijst/interruptingcow/issues/export | |
{"status": "ACCEPTED", "count": "1", "total": "4", "phase": "Issues", "pct": "25"} | |
$ # until it's ready: | |
$ curl -u evzijst:passwd -X GET https://api.bitbucket.org/1.0/repositories/evzijst/interruptingcow/issues/export |
NewerOlder