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
#!/usr/bin/env python | |
#-*- coding: UTF-8 -*- | |
import marisa_trie | |
def uread(f): | |
for line in f: | |
yield line.decode('utf8', 'replace') | |
ds = [] |
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
#!/usr/bin/env python | |
# -*- charset utf8 -*- | |
import pyaudio | |
import numpy | |
import math | |
import matplotlib.pyplot as plt | |
import matplotlib.animation | |
RATE = 44100 |
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
let distance = 0 | |
bluetooth.onBluetoothConnected(() => { | |
basic.showLeds(` | |
. # # . . | |
. # . # . | |
. # # . . | |
. # . # . | |
. # # . . | |
`) | |
}) |
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
let steering = 0 | |
let led2 = 0 | |
let distance = 0 | |
bluetooth.onBluetoothConnected(() => { | |
basic.showLeds(` | |
. # # . . | |
. # . # . | |
. # # . . | |
. # . # . | |
. # # . . |
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
#!/bin/bash | |
cat > ~/.stack/global-project/stack.yaml <<END | |
# This is the implicit global project's config file, which is only used when | |
# 'stack' is run outside of a real project. Settings here do _not_ act as | |
# defaults for all projects. To change stack's default settings, edit | |
# '/home/netom/.stack/config.yaml' instead. | |
# | |
# For more information about stack's configuration, see | |
# http://docs.haskellstack.org/en/stable/yaml_configuration/ |
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
; Credits: https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html | |
; Compile: nasm -f bin -o hello hello.asm | |
BITS 32 | |
org 0x08048000 | |
ehdr: ; Elf32_Ehdr | |
db 0x7F, "ELF", 1, 1, 1, 0 ; e_ident | |
times 8 db 0 | |
dw 2 ; e_type |
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
#!/bin/bash | |
NOW=$(date +%s) | |
HEXFNAME=bert-data-${NOW}.hex | |
BINFNAME=bert-data-${NOW}.bin | |
{ dmesg \ | |
| grep '\[Hardware Error]: \+[0-9]' \ | |
| sed -r '/.*/ {s/^.*\[Hardware Error]: +[0-9a-FA-F]{4}([0-9a-FA-F]{4}): (([0-9a-FA-F]{8} ){4}).*$/:10 \1 00 \2 00/;s/ //g}' \ | |
; echo ':00000001FF'; \ |