Skip to content

Instantly share code, notes, and snippets.

View adamburmister's full-sized avatar

Adam Burmister adamburmister

View GitHub Profile
@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>
@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) {
@adamburmister
adamburmister / gist:151ae818dd2462ffd56c
Created July 14, 2015 03:01
LeetCode Largest Number
/**
* @param {number[]} nums
* @return {string}
*/
var largestNumber = function(nums) {
return nums
.sort(function(a, b) { return ( (b + '' + a) - (a + '' + b) ); })
.join('')
.replace(/^0*/,'') || '0';
};
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
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"
}
#!/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 "^$"