Skip to content

Instantly share code, notes, and snippets.

@cyber-murmel
cyber-murmel / ice40web.py
Created February 13, 2020 11:41
ice40web.py
# -*- coding: utf-8 -*-
# Copyright 2020 by https://badge.team/
# This file is released under the "CC0 1.0 Universal" license.
# https://creativecommons.org/publicdomain/zero/1.0/legalcode
from machine import Pin, SPI
import wifi, urequests, sys
# Pins
ctrl_interface=/run/wpa_supplicant
### key_mgmt=NONE
network={
ssid="hamburg.freifunk.net"
key_mgmt=NONE
priority=0
}
```
ctrl_interface=/run/wpa_supplicant
### key_mgmt=NONE
network={
ssid="hamburg.freifunk.net"
key_mgmt=NONE
priority=0
}
@cyber-murmel
cyber-murmel / bandcampscrape.md
Last active October 20, 2018 08:30
Using bash and youtube-dl to scrape bandcamp

Usecase

Let's say there is a band on bandcamp you like and you would like to listne to their music even if zou are online. You may already know youtube-dl, but it's tedeous to download all the albums individually.

Code

First let's define a function that returns all the links to every album of one band.

bandcamp_album_links () {
        BAND=$(echo $1 | grep -Po 'https?://\w+\.bandcamp\.com')
        for ALBUM in $(curl -s $BAND/music | grep -Po '/album/[\w-]+')
 do
# front = ./grb/cnc_test-F.Cu.gbr
back = ./grb/cnc_test-B.Cu.gbr
outline = ./grb/cnc_test-Edge.Cuts.gbr
drill = ./grb/cnc_test-PTH.drl
output-dir = ./cnc
# common
metric = yes
metricoutput = yes
zsafe = 5