Skip to content

Instantly share code, notes, and snippets.

Output for `lsusb.py -iIce` with the 512GB exfat external usb drive plugged in
------------------------------------------------------------------------------
usb1 1d6b:0002 09 2.00 480MBit/s 0mA 1IF (Linux 4.10.10-1-ARCH xhci-hcd xHCI Host Controller 0000:00:14.0)
(EP) 00: Control attr 00 len 07 max 040
1-0:1.0 (IF) 09:00:00 1EP (Hub::Full speed (or root) hub) hub 
(EP) 81: Interrupt (256ms) attr 03 len 07 max 004
1-9 04f3:2356 00 2.01 12MBit/s 100mA 1IF (ELAN Touchscreen)
(EP) 00: Control attr 00 len 07 max 008
1-9:1.0 (IF) 03:00:00 2EPs (Human Interface Device:No Subclass:None) usbhid 
Contents of `/etc/fstab`
------------------------
#
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/nvme0n1p6
UUID=ff9452b7-a7e9-4627-9355-06417be1ac16 / ext4 rw,relatime,data=ordered 0 1
@mitchmindtree
mitchmindtree / rust-portaudio_build_error
Created May 12, 2015 00:18
Travis' rust-portaudio build error.
$ cargo build --verbose
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading bitflags v0.1.1
Downloading num v0.1.24
Downloading rand v0.3.8
Downloading pkg-config v0.3.4
Downloading rustc-serialize v0.3.14
Downloading libc v0.1.7
Compiling bitflags v0.1.1
Running `rustc /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-0.1.1/src/lib.rs --crate-name bitflags --crate-type lib -g -C metadata=518ea12e21428edd -C extra-filename=-518ea12e21428edd --out-dir /home/travis/build/jeremyletang/rust-portaudio/target/debug/deps --emit=dep-info,link -L dependency=/home/travis/build/jeremyletang/rust-portaudio/target/debug/deps -L dependency=/home/travis/build/jeremyletang/rust-portaudio/target/debug/deps -Awarnings`
mindTree:r3 Mitch$ ./target/debug/
.fingerprint/ build/ deps/ examples/ native/ rid3 rid3.dSYM/
mindTree:r3 Mitch$ ./target/debug/rid3
couldn't open dialog: Error { repr: Os(2) }
mindTree:r3 Mitch$ vim
Press ENTER or type command to continue
mindTree:r3 Mitch$ ./target/debug/rid3
mindTree:r3 Mitch$ cargo run src/bin/rid3.rs
@mitchmindtree
mitchmindtree / shadowing.elm
Created February 16, 2015 09:48
Strange behaviour when shadowing variables in Elm
import Graphics.Element (..)
import Text (..)
type alias A = { a: Float }
-- Why does this not work?
increment1 : A -> A
increment1 ({ a } as aye) =
let a = a + 1
in { aye | a <- a }
@mitchmindtree
mitchmindtree / strange_assoc_types.rs
Created February 9, 2015 07:16
Strange associated types behaviour
use std::num::Float;
trait Foo {
type A: Float;
// Why is it that this doesn't work...
fn sub_a(&self, a: <Self as Foo>::A, b: <Self as Foo>::A) -> <Self as Foo>::A {
a - b
}
@mitchmindtree
mitchmindtree / gist:66888b67ac15ba612c5e
Last active August 29, 2015 14:14
DspNode trait implementation
/// DSP Node trait. Implement this for any audio instrument or effects types that are to be used
/// within your DSP chain. Override all methods that you wish. If the Node is a parent of other
/// DSP nodes, be sure to implement the `inputs` method.
pub trait Node {
type Sample: Sample = f32;
type Buffer: DspBuffer = Vec<f32>;
/// Return the volume for this Node.
#[inline]
fn vol(&self) -> Volume { 1.0 }
@mitchmindtree
mitchmindtree / ice-skating-mario
Created January 4, 2015 19:47
Mario Ice-Skating (first Elm code)
import Color (..)
import Graphics.Collage (..)
import Graphics.Element (..)
import Keyboard
import Signal
import Time (..)
import Window
-- MODEL
mario = { x=0, y=0, vx=0, vy=0, dir="right" }
@mitchmindtree
mitchmindtree / traitmethodoverriding.rs
Last active May 1, 2024 06:19
The ability for derived traits to override their parent trait methods.
// Firstly - I LOVE Rust! This is just something that has
// been cropping up more and more in my Rust coding experience
// recently, so I though it could be good to discuss it with
// fellow Rustaceans!
//
// TOPIC:
// I'd love the ability to be able to override parent trait
// methods with default methods in the child trait.
//
// The following is a pattern that I come across very often:
@mitchmindtree
mitchmindtree / RustQuestion6.rs
Last active August 29, 2015 14:02
A question regarding structs containing multiple structs with the same lifetime.
//
// I'd like to be able to gain access to the 'foo', 'bar' and 'baz' members
// via the "get_my_struct" trait method.
//
// I'd like to be able to access both 'foo' and 'bar' as well as a mutable ref
// to 'baz' in order to write to 'baz' within the 'calc_baz' method.
//
struct A<'a> {
i: int