Skip to content

Instantly share code, notes, and snippets.

Rasmus Bondesson raek

Block or report user

Report or block raek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View atitd_macro.ino
#include "Keyboard.h"
void setup() {
pinMode(6, INPUT_PULLUP);
pinMode(13, OUTPUT);
void loop() {
raek /
Created Nov 30, 2018
cowsay widget for urwid
import urwid
import subprocess
class Cowsay(urwid.WidgetDecoration):
_LEFT = 2
_RIGHT = 2
_TOP = 1
import urwid as u
with open('text.txt', 'rt') as f:
text_lines ='\n')
def unhandled_input(key):
pass #body.keypress(key)
def send_line(line):
View hello_kitty_ledslinga.ino
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#define PIN A2
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
raek / ledsinga.ino
Last active Jan 22, 2018
View ledsinga.ino
// Installation:
// * Install the "Adafruit NeoPixel" from the Arduino library manager.
// This is a modified example of the "standtest" example included in the library. Changes:
// * Set led strip pin to pin 11
// * Set number of leds to 30
// * made the loop() body only run the rainbow code
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
raek / nes_controller.ino
Last active Oct 26, 2017
A-Star 32U4 NES Controller
View nes_controller.ino
#include <Keyboard.h>
const int vccPin = 2; // red
const int gndPin = 3; // black
const int shiftPin = 4; // yellow
const int latchPin = 5; // green
const int dataPin = 6; // blue
char buttonToKey[8] = {
'f', // A
View pipe.h
struct input_t;
bool input_accept(struct input_t *input, reg_t *value);
void input_decline(struct input_t *input);
struct output_t;
bool output_offer(struct output_t *output, reg_t value);
void output_abstain(struct output_t *output);
raek /
Created Oct 5, 2016
YAML reformatting
# to install yaml:
# sudo pip install pyyaml
import argparse
import yaml
import sys
parser = argparse.ArgumentParser(description="normalize YAML formatting")
parser.add_argument("--mode", help="how to pretty-print innermost nodes",
raek / all.c
Created Sep 21, 2016
unused symbols and GCC
View all.c
#include <stdio.h>
int used(void)
printf("all used\n");
return 0;
int unused(void)
raek / puzzle5.c
Created Sep 8, 2016
Puzzle of the Week #5: C'ing is believing
View puzzle5.c
#include <stdio.h>
/* Run like this:
* gcc -Wall -Wextra puzzle5.c && ./a.out
/* TODO: remove these weird unused functions */
long int g(long int x) {
return x;
You can’t perform that action at this time.