This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html><head> | |
<meta charset="utf-8"> | |
<title>Testing multiple ids</title> | |
</head><body> | |
<p id="one"> | |
<span id="not_unique">One</span> | |
</p> | |
<p id="two"> | |
<span id="not_unique">Two</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias xed='function _xed() { [ ! -f $1 ] && touch $1; xed `python -c "import os,sys;print os.path.realpath(sys.argv[1])" $1`; };_xed' |
All price estimates are for one-way. Car and train and bus return doubles price, air has significant discount for round trip.
TODO: For longer trips it can be a little cheaper to ride Amtrak by signing up for rewards, buying miles, then booking tickets; haven't calculated cost for Portland yet.
Downtown Portland is about 215 miles from the Tri-Cities and takes about 3h30m. Cost calculated with gas at $3.69/gal and fuel economy averaging 30mpg (i.e. 12.3¢/mile).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SPI_DEV = "/dev/spidev0.0", // hardware will be connected to pins matching a certain Linux SPI device | |
HTTP_PORT = 0, // if you leave 0, a port gets randomly assigned | |
POLL_INTERVAL = 1e3; // equivalent to 1 second, set to `20` for 20 milliseconds | |
// this global variable will store the values | |
var most_recent_value = null; | |
var spiInstance = require('pi-spi').initialize(SPI_DEV); // this sets up the SPI device for use in node.js | |
// then we register a timeout that will get called repeatedly at an approximate interval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see e.g. http://stackoverflow.com/a/7677387/179583 | |
import code | |
code.interact(local=dict(globals(), **locals())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>WebRTC p2p data</title> | |
<script src="https://webrtc-samples.googlecode.com/svn/trunk/apprtc/js/adapter.js"></script> | |
</head> | |
<body> | |
Testing WebRTC connection. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface MyAnimation : NSAnimation {} | |
@property NSUInteger frameCount; | |
@end | |
@implementation MyAnimation | |
- (void)startAnimation { | |
_frameCount = 0; | |
[super startAnimation]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WORKAROUND: custom statusCheck to treat 202 responses as an error | |
// if Cloudant sends this, we can't be sure the write won't conflict | |
// see https://github.com/cloudant/bigcouch/issues/55 | |
// and https://cloudant.com/for-developers/faq/data/ | |
// and http://bigcouch.cloudant.com/api | |
// it's futile to attempt a unanimous quorum read to be sure (r=N is only advisory) | |
// so…assume the worst (e.g. conflicting or lost update) and treat these like a 500 | |
// NOTE: this is copy-pasta from Fermata's builtin plugins. | |
fermata.registerPlugin('statusCheck_bigcouch', function (transport) { | |
return function (request, callback) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /media/data_usb/logging/greenhouse.log | strings | sed -r 's/^([^ ]+).*waterTemp=([0-9]+).*$/\1 \2/' |