Skip to content

Instantly share code, notes, and snippets.

mmc@0x23F00000 {
cd-gpios = <&gpio 5>;
wp-gpios = <&gpio 6>;
};
@bravegnu
bravegnu / mshell.c
Last active July 27, 2016 11:04
Updated some error handling and error reporting code.
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
@bravegnu
bravegnu / parser.py
Last active December 22, 2015 10:02
Find and Replace First Dot.
matching = {
'{': '}',
'(': ')'
}
def find_first_dot(line):
paren_stack = []
for pos, ch in enumerate(line):
if ch in matching:
@bravegnu
bravegnu / head.py
Last active August 25, 2016 01:19
Implementation of head using docopt
"""
Usage: head [options] [FILE]...
-c K, --bytes=K print the first K bytes of each file;
with the leading `-', print all but the last
K bytes of each file
-n K, --lines=K print the first K lines instead of the first 10;
with the leading `-', print all but the last
K lines of each file [default: 10]
-q, --quiet, --silent never print headers giving file names