Skip to content

Instantly share code, notes, and snippets.

View adamburmister's full-sized avatar

Adam Burmister adamburmister

View GitHub Profile
#include <msp430x20x3.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= BIT6; // Set P1.6 to output direction
P1SEL |= BIT6; // P1.6 to TA0.1
CCR0 = 1000-1; // PWM Period
@adamburmister
adamburmister / porsche.sh
Created October 19, 2017 18:33
CLI to look up Porsche vehicle details (sale price, options lists, warranty info) from a VIN
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: $0 VIN" >&2
exit 1
fi
# Usage:
output_file_name="/tmp/porsche-$1.html"
curl -s -# http://admin.porschedealer.com/reports/build_sheets/print.php\?vin\=$1 | pup "style, .container" > $output_file_name
@adamburmister
adamburmister / names_to_sentence.js
Created September 15, 2017 17:44
Convert names array to sentence structure
function cleanNameInput(names) {
return names
.map(name => name.trim())
.filter(name => name)
}
function namesToSentence(names = [], options = {}) {
names = cleanNameInput(names)
const before = names.slice(0, options.length || -1)
const after = names.slice(options.length || -1)
Markdown: Syntax
================
<ul id="ProjectSubmenu">
<li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li>
<li><a href="/projects/markdown/basics" title="Markdown Basics">Basics</a></li>
<li><a class="selected" title="Markdown Syntax Documentation">Syntax</a></li>
<li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li>
<li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li>
</ul>
#!/bin/bash
echo "--- Type A ---"
dig $1 A | grep -v "^\;" | grep -v "^$"
echo "--- Type CNAME ---"
dig $1 CNAME | grep -v "^\;" | grep -v "^$"
echo "--- Type NS ---"
dig $1 NS | grep -v "^\;" | grep -v "^$"
echo "--- Type MX ---"
dig $1 MX | grep -v "^\;" | grep -v "^$"
@adamburmister
adamburmister / JavaScriptSafeNavigation.md
Last active February 17, 2016 18:04 — forked from d-akara/JavaScriptSafeNavigation.md
JavaScript Safe Navigation

Experimental Safe JavaScript Navigation

Implemented using ES6 Proxies and Symbols

Suggestions for improvements welcome!

const NON_NAVIGABLE_TARGET = Symbol()

function safe(target) {
require 'Date'
# precondition: assumed days_of_our_lives is defined as a range, and
# purpose? method is defined (left as an exercise for the implementor) of this class.
days_of_our_lives.reduce do |life, time|
level += 1 and eat 'cake' if Date.today.day == 10 && Date.today.month == 12
purpose?(life, time)
end
# TODO: include gems in package
require 'rubygems'
require 'growl'
require 'net/http'
require 'net/https'
require 'yajl/json_gem'
# TODO: Read from ~/.backchatio_notifier file
API_KEY="YOUR_API_KEY_HERE"
STREAM_SLUG="controlbox"
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Create an EC2 instance running the Amazon Linux 32 bit AMI. The AMI is chosen based on the region in which the stack is run. This example creates an EC2 security group for the instance to give you SSH access.",
"Parameters" : {
"KeyName" : {
"Description" : "Name of and existing EC2 KeyPair to enable SSH access to the instance",
"Type" : "String"
}
@adamburmister
adamburmister / http streaming with backchat.io.txt
Created February 4, 2011 08:41
Curl a BackChat.io stream using your login and API key
curl -H 'Authorization: Backchat 3b43ebca5e9703bbbeb5d0f87c87c962' https://stream.backchat.io/example-stream-name