This file contains 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
import urwid as u | |
with open('text.txt', 'rt') as f: | |
text_lines = f.read().split('\n') | |
def unhandled_input(key): | |
pass #body.keypress(key) | |
def send_line(line): | |
pass |
This file contains 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
#include <Adafruit_NeoPixel.h> | |
#ifdef __AVR__ | |
#include <avr/power.h> | |
#endif | |
#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: |
This file contains 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
// 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__ |
This file contains 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
#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 |
This file contains 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
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); |
This file contains 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
# 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", |
This file contains 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
#include <stdio.h> | |
int used(void) | |
{ | |
printf("all used\n"); | |
return 0; | |
} | |
int unused(void) | |
{ |
This file contains 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
#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; | |
} |
This file contains 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
import pygame | |
import sys | |
assert sys.version_info.major == 2, "This is a Python 2 program" | |
def draw(surface, width, height, time): | |
surface.fill((0, 255, 0)) | |
for i in range(256): |
This file contains 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
#include <AStar32U4Prime.h> | |
const char key = '.'; | |
Pushbutton buttonD(0); | |
void setup() { | |
Keyboard.begin(); | |
} | |
void loop() { | |
if (buttonD.getSingleDebouncedPress()) { Keyboard.press(key); } |