Skip to content

Instantly share code, notes, and snippets.

View azdle's full-sized avatar

Patrick Barrett azdle

View GitHub Profile
@azdle
azdle / Exosite_Weather_Station.ino
Created September 3, 2014 21:19
Exosite Powered Sparkfun Arduino Weather Station
/*
** Exosite Modifcations By Patrick Barrett <patrickbarrett@exosite.com>
** Modified 03-09-2014
**
** Note: This runs on the Arduino Yun, but requires modifications to the libraries,
** provided by Sparkfun, to use software I2C (https://github.com/greiman/DigitalIO)
*/
/*
Based on the work by
@azdle
azdle / example_use.lua
Last active August 29, 2015 14:06
Basic Lua Library for Exosite's JSON RPC API
local exosite = require 'exosite'
local json = require 'dkjson'
local exo = exosite.rpc:new{cik = "9829879a04efb8f4a1b42e22245739678fd4a94e"}
local status, response = exo:create{
"dataport",
{
format = "float",
name = "Temperature",

Keybase proof

I hereby claim:

  • I am azdle on github.
  • I am psbarrett (https://keybase.io/psbarrett) on keybase.
  • I have a public key whose fingerprint is E520 BFB2 9876 288A D460 4442 58E8 B2F2 D323 B505

To claim this, I am signing this object:

@azdle
azdle / count_all.js
Created April 6, 2015 17:53
Minnebar Vanity Script
var _ = require('underscore'),
async = require('async'),
page = require('webpage').create(),
system = require('system');
if (system.args.length !== 3) {
console.log('Usage: count.js <min_id> <max_id>');
phantom.exit();
}
@azdle
azdle / b64widget.js
Last active August 29, 2015 14:20
Base64 Image in a Widget
// this is an example of using a base64 image in an exosite portals widget
function( container, portal )
{
// this is the actual image, you can generate this string on most
// mac/linux computers by using `base64 image.png` from the command line
var base64_image = "iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";
// helpful for debugging
console.log('widget refresh');
@azdle
azdle / campsites_sht.geojson
Created May 16, 2016 23:21
Superior Hiking Trail as GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@azdle
azdle / main.rs
Last active January 14, 2017 20:07
UDP Doubler
extern crate futures;
extern crate tokio_core;
extern crate env_logger;
use std::str;
use std::io::{Result, Error, ErrorKind, Write};
use std::net::SocketAddr;
use futures::{Stream, Sink};
use tokio_core::net::{UdpSocket, UdpCodec};
### Keybase proof
I hereby claim:
* I am azdle on github.
* I am psbarrett_st (https://keybase.io/psbarrett_st) on keybase.
* I have a public key ASAOtRdhF-9oHcFeX3FrkhM5E3TKGl7B-BIGTjoeybR_4go
To claim this, I am signing this object:
@azdle
azdle / books_download_cmds.js
Last active March 18, 2022 19:34
Humble Bundle Easy Get All
//
// This scripts builds wget commands for you to paste into a terminal. It will download
// all formats of all books currently showing on the page.
//
cmds = "";
for (a of document.getElementsByTagName("a")) {
if (a.href.startsWith("https://dl.humble.com")) cmds += "wget --content-disposition '" + a.href + "'<br>";
};
@azdle
azdle / configuration.nix
Last active February 8, 2018 23:55
QEMU Guest Base NixOS Config
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;