Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 }
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 / 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`
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
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 
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 
@mitchmindtree
mitchmindtree / windows_environment_variables.md
Created October 21, 2018 08:42
How to permanently set user environment variables on Windows

Setting an Environment Variable on Windows

Here are three ways you can set the user environment variable FOO with the value path\to\foo so that the variable persists across sessions.

  1. Using the command prompt:
    setx FOO "path\to\foo"
    
  2. Using powershell:
@mitchmindtree
mitchmindtree / vulkaninfo-output.txt
Last active July 20, 2019 10:51
vulkaninfo-output
==========
VULKANINFO
==========
Vulkan Instance Version: 1.1.112
Instance Extensions:
====================