Skip to content

Instantly share code, notes, and snippets.

View adamabernathy's full-sized avatar
👋

Adam C. Abernathy adamabernathy

👋
View GitHub Profile
@adamabernathy
adamabernathy / table.js
Created January 12, 2017 21:36
additive search problem
var Excel = React.createClass({
displayName: 'Excel',
__preSearchData: null,
_log: [],
propTypes: {
headers: React.PropTypes.arrayOf(
React.PropTypes.string
),
initialData: React.PropTypes.arrayOf(
@adamabernathy
adamabernathy / d3-bs-tooltip
Created January 3, 2017 16:14
Calls BS tooltip from a D3 event
.on("mouseover", function (d) {
// Call Bootstrap tooltip, this is one of the few jQuery dependencies
$(this).tooltip({
"title": "Tooltip text or function call",
"placement": "right",
"html": true,
"container": "body"
}).tooltip("show");
});
@adamabernathy
adamabernathy / linspace.js
Created December 2, 2016 17:30
Creates a linearly spaced array
/**
* Create a linearly spaced array
*
* @param {number} start - starting integer
* @param {number} nvalues - how many values
* @param {number} interval - interval (optional)
*/
function __linspace(start, nvalues, interval) {
if (typeof interval === "undefined") { interval = 0; }
var i;
@adamabernathy
adamabernathy / plot-js-windrose.html
Last active August 31, 2021 11:23
Uses HighCharts.js to plot a windrose from SynopticLabs' API
<!DOCTYPE html>
<html>
<head>
<title>Wind Rose Example</title>
<!-- You need to import these -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
@adamabernathy
adamabernathy / batch-rename.sh
Created April 27, 2016 19:39
Rename file extensions in batch mode
for file in *.html; do
mv "$file" "`basename $file .html`.txt"
done
; pconfig
pconfig = {current:1, xrange:[0, 10], thick:1.5}
p = plot(x, y, name='my_plot', $
_EXTRA = pconfig, $
dimensions = [700, 800], $
title = 'My Awesome Plot', $
ytitle = 'F(x)')
@adamabernathy
adamabernathy / thermocouple.ino
Last active April 7, 2016 21:04
Arduino Thermocouple
/* Thermocouple */
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A1);
/***********************************************************************
* File name: penny.ino *
* *
* Purpose: Logs data from an array of digital weather sensors and *
* stores the data in CSV format on a standard SD Card. *
* *
* - File references: *
* Name I/O Description *
* ---------------------------------------------------------------- *
* *
@adamabernathy
adamabernathy / read-hdf5-variable-idl
Created June 24, 2015 21:11
Read a variable from a HDF5 file in IDL
function get_hdf5,f,branch,var_name
fid = h5f_open(f) ; open file
gid = h5g_open(fid,branch) ; access the branch
did = h5d_open(gid,var_name) ; access the variable
var = h5d_read(did) ; read the variable
h5d_close,did ; close the variable
h5f_close,fid ; close file
@adamabernathy
adamabernathy / show-a-lat-lon-box-idl
Created June 23, 2015 16:03
Print a Lat/Lon box to a console window in IDL.
pro print_loi_box,nlat,slat,elon,wlon
; Box dimensions - Comment out for real use.
nlat=90.0
slat=-43.0
wlon=-70
elon=180.0
; Graphic parts
lg_offset = ' '