Skip to content

Instantly share code, notes, and snippets.

View oschettler's full-sized avatar

Olav Schettler oschettler

View GitHub Profile
@oschettler
oschettler / primzahlen.py
Created June 4, 2019 20:40
Primzahlen nach dem Sieb des Eratosthenes für die vierte Klasse
# Arbeitsheft 4
# Seite 86
primzahlen = [2]
zahlen = list(range(2, 101))
def streiche(vielfaches_von):
return [zahl
for zahl in zahlen
if zahl % vielfaches_von != 0]
@oschettler
oschettler / rateomatic.ino
Last active April 6, 2019 22:44
Rate-o-Matic with M5SICK-C and servo. Connect to address shown on display and vote. Home button for next vote
/**
* Survey - Display a survey result
*
* License: MIT
*
* Copyright (c) 2019 Olav Schettler
*
* Hiermit wird unentgeltlich jeder Person, die eine Kopie der Software und der zugehörigen
* Dokumentationen (die "Software") erhält, die Erlaubnis erteilt, sie uneingeschränkt zu nutzen,
* inklusive und ohne Ausnahme mit dem Recht, sie zu verwenden, zu kopieren, zu verändern,
@oschettler
oschettler / puck-avea.js
Last active February 9, 2019 23:49
Control an Elgato Avea Bulb with a Puck.JS
/**
* Control an Elgato Avea Bulb:
*
* Single click - toggle on/off
* Double click - cycle through three brightness levels
*
* License: MIT
* (c) 2019 Olav Schettler <olav@schettler.net>
*/
var values = [
@oschettler
oschettler / linien.py
Last active December 31, 2018 10:40
Lines with PyGameZero
# Linien
# License: MIT
# Olav Schettler <olav@schettler.net>
WIDTH = 800
HEIGHT = 600
offset = 0
def incr_offset():
@oschettler
oschettler / circuit-lamp
Created December 31, 2018 00:09
Lampe - A Colorful Lamp with Adafruit Circuit Playground Express and an Infrared Remote Control
# Lampe v0.1
# License MIT
# Olav Schettler <olav@schettler.net>
# These need drivers https://circuitpython.readthedocs.io/en/latest/docs/drivers.html
import pulseio
import board
import adafruit_irremote
from adafruit_circuitplayground.express import cpx
if (
recipePositionWithinSearchResult <= this.attributes.searchResults.length
) {
recipeSearchItem = this.attributes.searchResults[
recipePositionWithinSearchResult - 1
].recipe;
this.attributes.recipeSearchItem = recipeSearchItem;
this.attributes.recipePosition = recipePositionWithinSearchResult - 1;
} else {
let message;

Keybase proof

I hereby claim:

  • I am oschettler on github.
  • I am olav (https://keybase.io/olav) on keybase.
  • I have a public key ASDq7x2poSiNAbo2gLcs3NZDzIykbDf1LtJuASXpeO5Ahwo

To claim this, I am signing this object:

from microbit import *
import music
def display_digit(x, digit):
"Show a single digit in column"
x = 4 - x
digit = 9 - digit
for j in range(5):
y = digit - j
if y >= 0 and y < 5:
<?php
class DrupalValetDriver extends ValetDriver
{
private function documentRoot($sitePath)
{
return $sitePath . '/web';
}
/**
@oschettler
oschettler / delicious-tinkerthon.html
Last active December 11, 2015 19:27
Javascript snippet to display delicious bookmarks on a page. See it in action at https://tinkerthon.de
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<div class="col-sm-3 col-xs-6">
<h4>Morsels</h4>
<p>Some delicious bookmarks.</p>
<ul class="delicious"></ul>
<p>Enjoy!</p>
<script>
jQuery(function ($)