Skip to content

Instantly share code, notes, and snippets.

@rknLA
rknLA / render.cpp
Created December 4, 2018 23:02
modified delay example
// original at https://github.com/BelaPlatform/Bela/blob/master/examples/04-Audio/delay/render.cpp
// this version is modified to use an FSR to (haphazardly) control delay time and feedback.
/*
____ _____ _ _
| __ )| ____| | / \
| _ \| _| | | / _ \
| |_) | |___| |___ / ___ \
|____/|_____|_____/_/ \_\
@rknLA
rknLA / ex.py
Created November 29, 2016 11:58
syntax error at arrow > character
def some_really_long_function_name(long_arg: str, even_longer_arg: int) ->
str:
"""a silly example"""
return long_arg + str(even_longer_arg)
@rknLA
rknLA / playground.swift
Created August 11, 2016 15:34
return a specified generic without passing a type?
//: Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
struct VarType<T> {
let name: String
let val: T
}
pi@raspberrypi:~ $ ls -la
total 28
drwxr-xr-x 3 pi pi 4096 Apr 16 15:31 .
drwxr-xr-x 3 root root 4096 Mar 18 08:09 ..
-rw------- 1 pi pi 677 Apr 16 16:06 .bash_history
-rw-r--r-- 1 pi pi 220 Mar 18 08:09 .bash_logout
-rw-r--r-- 1 pi pi 3512 Mar 18 08:09 .bashrc
-rw-r--r-- 1 pi pi 675 Mar 18 08:09 .profile
drwx------ 2 pi pi 4096 Apr 16 15:31 .ssh
pi@raspberrypi:~ $ sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
@rknLA
rknLA / gist:50c1d24cbe434a979b75e8c79eee0b32
Created April 16, 2016 16:15
Pi3 / Jessie Lite WiFi issue
root@raspberrypi:/home/pi# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
Successfully initialized wpa_supplicant
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=netdev'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.
root@raspberrypi:/home/pi# pgrep wpa_supp
class BarContoller
def update
# ...
SomeExternalModule::SomeClassInTheModule.my_method
# kaboom:
# NoMethodError (undefined method `my_method' for #<Class:0x007fd3964eb468>):
end
end
@rknLA
rknLA / midi debugging
Created November 8, 2015 18:46
joys of swift
(lldb) po self.internalVirtualDestinations
<__NSArrayM 0x144669170>(
<MIKMIDIDestinationEndpoint: 0x144642130> Network Session 1,
<MIKMIDIDestinationEndpoint: 0x144692bd0> Grain Science
)
(lldb) po deviceManager.virtualDestinations as! NSArray
"2 values"
{
@rknLA
rknLA / logging.swift
Last active October 18, 2015 21:26
A UITouch's raw `_pressure` mapped to its `force`
/* This is the swift code used to generate the following python dict list */
func someTouchHandler(theTouch: UITouch) {
let rawPressure = theTouch.valueForKey("_pressure") as! CGFloat
let force = theTouch.force
print("Force: \(force)\t\tRaw pressure: \(rawPressure)")
}
strides = {
181: 3.0,
187: 2.0,
201: 2.0,
210: 2.0,
215: 2.0,
216: 2.0,
242: 2.0,
248: 2.0,
251: 2.0,
@rknLA
rknLA / anomalous_firm_strides.py
Created October 12, 2015 21:27
indexes of the firm distances that exhibited anomalies, as well as their anomalous stride values
strides = {
1: 3.0,
3: 7.0,
4: 7.0,
134: 2.0,
149: 2.0,
154: 2.0,
157: 2.0,
165: 2.0,
180: 2.0,