Skip to content

Instantly share code, notes, and snippets.

View oschettler's full-sized avatar

Olav Schettler oschettler

View GitHub Profile
@oschettler
oschettler / hallowelt.c
Created December 15, 2011 18:18
Hallo Welt
#include <stdio.h>
main() { printf("Hallo Welt\n"); }
@oschettler
oschettler / sun01.bas
Created April 9, 2012 19:57
Sonnenbild
;
; Six charlieplexed LEDs on pins 1, 2, 4
; Ambient brightness is measured through LED 6
;
; pin1----+----+----------+---+
; 1v 2^ 5v 6^
; pin2----+----+--+---+ | |
; 3v 4^ | |
; pin4------------+---+---+---+
;
@oschettler
oschettler / bottle_block.py
Created September 27, 2013 07:20
A simple class to include blocks of code in a template for bottle.py
class Block:
'''
A simple block class for Bottle templates.
Usage:
Pass a named block into your template by returning it from an action:
return dict(scripts = Block('scripts'))
In your template, use it like this:
msgid ""
msgstr ""
"Project-Id-Version: static-press\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-05-14 14:46+0900\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2014-12-15 22:19+0200 \n"
"Last-Translator: Olav Schettler <olav@schettler.net>\n"
@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 ($)
<?php
class DrupalValetDriver extends ValetDriver
{
private function documentRoot($sitePath)
{
return $sitePath . '/web';
}
/**
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:

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:

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;
@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