Skip to content

Instantly share code, notes, and snippets.

View natevw's full-sized avatar

Nathan Vander Wilt natevw

View GitHub Profile
@natevw
natevw / python_interact_debug_snippet.py
Last active June 8, 2016 19:33
Helpful Python snippet to drop into code and get an instant "playground" at a breakpoint
# see e.g. http://stackoverflow.com/a/7677387/179583
import code
code.interact(local=dict(globals(), **locals()))
@natevw
natevw / AppDelegate.m
Last active March 14, 2016 23:10
Hook this up to a coupla text boxes and see NSAnimation only ever do 60fps, picture of sample interface at https://twitter.com/natevw/status/709516893917319168
@interface MyAnimation : NSAnimation {}
@property NSUInteger frameCount;
@end
@implementation MyAnimation
- (void)startAnimation {
_frameCount = 0;
[super startAnimation];
}
@natevw
natevw / notes.md
Last active October 10, 2022 22:09
Using Bus Blaster v4 with STM32F4x SWD

Using Bus Blaster v4 with STM32F4x SWD

For SWD (instead of normal JTAG) you need a different CPLD "buffer logic" image on the Bus Blaster, the KT-Link compatible ones seem like the recommended means.

# with buffer logic at https://github.com/dergraaf/busblaster_v4/blob/master/ktlink/ktlink.svf
# via http://dangerousprototypes.com/forum/viewtopic.php?f=37&t=5954 from https://github.com/mchck/mchck/wiki/Getting-Started#wiki-bus-blaster
curl -O https://github.com/dergraaf/busblaster_v4/raw/master/ktlink/ktlink.svf
openocd -f board/dp_busblaster_v3.cfg -c "adapter_khz 1000; init; svf /Users/natevw/Downloads/ktlink.svf; shutdown"
@natevw
natevw / cookie.js
Created September 18, 2015 21:26
Some simple cookie routines, in case needed later
@natevw
natevw / README.md
Last active August 29, 2015 14:20
Overflowed element styling

This fades the bottom of an element away when its content overflows. This seems a bit simpler way of accomplishing what did, although it requires calc support to work.

@natevw
natevw / sample.sh
Created March 23, 2015 18:58
Add secure note to keychain via CLI
security unlock-keychain
security -i
add-generic-password -U -C note -a '' -s "NOTE NAME" -w "SECRET PASSWORD"
@natevw
natevw / install_flatcam.sh
Last active March 17, 2024 21:37
how I got FlatCAM 8.1 working on OS X [a long time ago — see comment thread for lots of good tips from others!]
brew update
brew install pyqt geos spatialindex
easy_install pip
pip install virtualenv
cd Development/Others\'/
mkdir FlatCAM
cd FlatCAM
virtualenv env
source env/bin/activate
@natevw
natevw / gist:5ddc9230cbcc9f5a2f4b
Created February 6, 2015 17:28
Couchbase reports file
ubuntu@ip-N-N-N-N:~$ sudo tail -n 500 /opt/couchbase/var/lib/couchbase/logs/reports.log
started: [{pid,<0.496.0>},
{name,menelaus_web_alerts_srv},
{mfargs,{menelaus_web_alerts_srv,start_link,[]}},
{restart_type,permanent},
{shutdown,5000},
{child_type,worker}]
[error_logger:error,2015-02-06T9:26:44.504,ns_1@127.0.0.1:error_logger<0.6.0>:ale_error_logger_handler:do_log:203]
=========================SUPERVISOR REPORT=========================
@natevw
natevw / xed_better.sh
Last active April 8, 2019 06:35
Better `xed` — the CLI tool for Xcode is handy, but has a few issues that get in the way. For starters, if the file doesn't exist, the builtin `x\ed` won't create a new one. I also noticed that Xcode will open a symlink and let you edit, but then gets really angry when it tries to save. So…this.
alias xed='function _xed() { [ ! -f $1 ] && touch $1; xed `python -c "import os,sys;print os.path.realpath(sys.argv[1])" $1`; };_xed'
@natevw
natevw / arduino.cc
Created January 20, 2015 22:01
Maybe the Arduino sketch used with node-nrf/test.js?
/*
Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/
/**
* Example RF Radio Ping Pair