Skip to content

Instantly share code, notes, and snippets.

View tonyarkles's full-sized avatar

Tony Arkles tonyarkles

  • Persea Systems
  • Saskatoon, SK, Canada
View GitHub Profile
@tonyarkles
tonyarkles / gist:2962136
Created June 20, 2012 20:51
Error using Withings objectives
When I click on "Save" in the "Objectives" window, nothing happens. In the Chrome Error Console I see this:
Uncaught TypeError: Cannot read property 'grpid' of null Data.js:1784
Withings.Dashboard.Data.deleteObjective Data.js:1784
(anonymous function) http://my.withings.com/:1263
jQuery.event.handle jquery-1.4.4.js:2260
jQuery.event.add.elemData.handle.eventHandle
% Recorded the wav output from rtl_fm at 32k samples/sec when tuned to a TI CC2500 radio set to 2400 baud 2-FSK
w = wavread('cc2500-v1.wav');
w = w(500:2200);
bitwidth = 32000 / 2400; % (samples/sec) / (bits/sec) = (samples/bit)
header_bits = 32;
N = floor(header_bits * bitwidth);
ideal_header = zeros(1,N); % (string of 0xAA 0xAA 0xAA 0xAA, 1 is
% positive, 0 negative)
bit = 1; bitval = 1;
@tonyarkles
tonyarkles / radio.c
Last active August 29, 2015 14:15
radio init
void radio_init(void) {
/* Pin connections
* o PB5 radio reset
* o PB4 /cscon
* o PB3 /csdata
* PA7 mosi
* PA6 miso
* PA5 sck
* i PB15 plready
* i PB14 txdone
~/scratch$ radmyarchive.py
Traceback (most recent call last):
File "/home/aja042/scratch/rma-env/bin/radmyarchive.py", line 5, in <module>
pkg_resources.run_script('radmyarchive==1.0.0', 'radmyarchive.py')
File "/home/aja042/scratch/rma-env/local/lib/python2.7/site-packages/pkg_resources.py", line 488, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/home/aja042/scratch/rma-env/local/lib/python2.7/site-packages/pkg_resources.py", line 1361, in run_script
exec(script_code, namespace, namespace)
File "/home/aja042/scratch/rma-env/local/lib/python2.7/site-packages/radmyarchive-1.0.0-py2.7.egg/EGG-INFO/scripts/radmyarchive.py", line 8, in <module>
iex(26)> DigikeySearch.DigikeyParts.fetch("254523")
[{"Datasheets", "T9A Series"}, {"Product Photos", "T9AS1D12 Series"},
{"Catalog Drawings", "T9A Series"},
{"Featured Product", "Plug-In RelaysT9A Series Relys"},
{"3D Model", "3-1393210-3.pdf"},
{"PCN Packaging",
"Multiple Devices 23/Jan/2015Multiple Devices Packaging Reversal 20/May/2015 "},
{"Standard Package  ", "50"}, {"Category", "Relays"},
{"Family", "Power Relays, Over 2 Amps"}, {"Series", "T9A"},
{"Packaging  ", "Bulk  "}, {"Relay Type", "General Purpose"},
use Mix.Config
# In this file, we keep production configuration that
# you likely want to automate and keep it away from
# your version control system.
config :frontend, Your.App.Endpoint,
secret_key_base: "your secret key here"
# Configure your database
config :frontend, Your.App.Repo,
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
error_page 404 = @boom; # Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location /blammo {
add_header Content-Type text/plain;
location / {
try_files $uri $uri/ =404;
error_page 404 = @boom;
}
location /blammo {
add_header Content-Type text/plain;
return 200 "Hi there";
}
location @boom {

Keybase proof

I hereby claim:

  • I am tonyarkles on github.
  • I am tonyarkles (https://keybase.io/tonyarkles) on keybase.
  • I have a public key ASDiGuyz-2aJicPGtD0JQz8NuurOTOani7qEhUvKoHyZrwo

To claim this, I am signing this object:

@tonyarkles
tonyarkles / vec-overflow-demo.md
Last active October 6, 2021 16:25
Overflowing C++ Vectors

First example:

#include <vector>
#include <stdio.h>

int main(int argc, char* argv[]) {
  std::vector<int> foo(10, 0);
  std::vector<int> bar(10, 1);