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/make -s "${0%.*}" CFLAGS="-O2 -Wall -Werror" && ./"${0%.*}" "$@"; s=$?; rm ./"${0%.*}"; exit $s | |
#include <stdio.h> | |
#include <stdbool.h> | |
enum option_tag { OPTION_SOME, OPTION_NONE }; | |
#define option_type(T) { enum option_tag tag; T some; } | |
#define SOME(S) { .tag = OPTION_SOME, .some = S } | |
#define NONE() { .tag = OPTION_NONE } |
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
ISC License | |
Copyright (c) 2016, Job Vranish | |
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. | |
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
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
{ | |
"arch": "arm", | |
"cpu": "cortex-m4", | |
"data-layout": "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", | |
"disable-redzone": true, | |
"executables": true, | |
"llvm-target": "thumbv7em-none-eabi", | |
"morestack": false, | |
"os": "none", | |
"relocation-model": "static", |
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
def read_with_timeout(io_like, read_len, timeout) | |
timeout_time = Time.now + timeout | |
data = "" | |
loop do | |
begin | |
result = io_like.read_nonblock(read_len - data.length) | |
puts data | |
data += result | |
if block_given? |
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 | |
# read abelectronics ADC Pi V2 board inputs with repeating reading from each channel. | |
# # Requries Python 2.7 | |
# Requires SMBus | |
# I2C API depends on I2C support in the kernel | |
# Version 1.0 - 06/02/2013 | |
# Version History: | |
# 1.0 - Initial Release |
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
/* automatically generated by rust-bindgen */ | |
#![crate_type="staticlib"] | |
#[derive(Copy)] | |
pub struct StructUnnamed9 { | |
pub _bindgen_bitfield_1_: u32, | |
pub _bindgen_bitfield_2_: u32, | |
pub _bindgen_bitfield_3_: u32, | |
pub _bindgen_bitfield_4_: u32, |
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
/dts-v1/; | |
/ { | |
videocore { | |
clock_routing { | |
vco@PLLD { freq = <2000000000>; }; | |
chan@DPER { div = <8>; }; // APER will be 500MHz | |
}; // clock routing | |
pins_bplus { | |
pin_config { |
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
class QueueWithTimeout | |
def initialize | |
@mutex = Mutex.new | |
@queue = [] | |
@recieved = ConditionVariable.new | |
end | |
def <<(x) | |
@mutex.synchronize do | |
@queue << 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
require 'stringio' | |
class ADT < Struct | |
def self.members() @members end | |
def self.add_member(c) | |
@members ||= [] | |
@members << c | |
@members.length - 1 | |
end | |
def self.data(*args) |
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 dependencies: | |
cabal install logict | |
cabal install stream-monad | |
-} | |
import Control.Monad.Logic |
NewerOlder