Skip to content

Instantly share code, notes, and snippets.

@thoward
thoward / designer.html
Last active August 29, 2015 14:16
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-input/core-input.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@thoward
thoward / oscon-2014-group-bike-ride.md
Last active March 28, 2017 00:08
OSCON 2014 Group Bike Ride

OSCON 2014 Group Bike Ride

Love bikes and open source? In town for OSCON 2014? Join us for a group ride.

bike pic

WHEN

Wednesday, July 23rd 2014 at 6:00pm

@thoward
thoward / index.php
Created September 25, 2013 09:24
Simple PHP app to test if the app can connect to a bound mysql instance, in a CloudFoundry environment.
<?php
echo "<p>Testing the connection to the MySQL database.<p>";
echo "<p>vcap: " . getenv("VCAP_SERVICES") . "</p>";
$services_json = json_decode(getenv("VCAP_SERVICES"),true);
echo "<p>services: " . $services_json . '</p>';
@thoward
thoward / threebox.sh
Created September 25, 2013 09:19
Create a three-box environment using vagrant-testbed. Generates unique ssh keys for each box and removes default vagrant keys.
#!/bin/bash
# make three boxes
BOXES=3 IP_START=60 vagrant up
# generate ssh keys
if [ ! -f /tmp/testbed1.pub ]; then
ssh-keygen -b 2048 -t rsa -f /tmp/testbed1 -P "" -C "testbed1"
fi
@thoward
thoward / rabbit-shim.rb
Created September 25, 2013 09:12
Cloud Foundry Service Shims for Rabbit/Redis configs
#!/usr/bin/env ruby
#
# Shims Rabbit configuration for CloudFoundry
#
require 'json'
if ENV['VCAP_SERVICES']
$vcap_services ||= JSON.parse(ENV['VCAP_SERVICES'])
rabbit_service_name = $vcap_services.keys.find { |svc| svc =~ /rabbit/i }
rabbit_service = $vcap_services[rabbit_service_name].first
@thoward
thoward / index.html
Created September 25, 2013 08:25
Example of SSI includes for testing.
<html>
<body>
<h1>Party time!</h1>
<!--#include virtual="quote.html" -->
</body>

Man-Eating-Cats

by Haruki Murakami
Translated by Philip Gabriel

Source

I bought a newspaper at the harbor and came across an article about an old woman who had been eaten by cats. She was seventy years old and lived alone in a small suburb of Athens -- a quiet sort of life, just her and her three cats in a small one-room apartment. One day, she suddenly keeled over face down on the sofa -- a heart attack, most likely. Nobody knew how long it had taken for her to die after she collapsed. The old woman didn't have any relatives or friends who visited her regularly, and it was a week before her body was discovered. The windows and door were closed, and the cats were trapped. There wasn't any food in the apartment. Granted, there was probably something in the fridge, but cats haven't evolved to the point where they can open refrigerators. On the verge of starvation, they were forced to devour their owner's flesh.

I read this articl

@thoward
thoward / iptables-udp-flood.txt
Created August 8, 2013 00:04
Prevent UDP flood
# Outbound UDP Flood protection in a user defined chain.
iptables -N udp-flood
iptables -A OUTPUT -p udp -j udp-flood
iptables -A udp-flood -p udp -m limit --limit 50/s -j RETURN
iptables -A udp-flood -j LOG --log-level 4 --log-prefix 'UDP-flood attempt: '
iptables -A udp-flood -j DROP
@thoward
thoward / output.txt
Created May 21, 2013 06:55
Explanation of my calculations about StrangeLoop economics, based on public information available in sponsorship prospectus/sponsor page/ticketing page/etc. Relevant Links: https://thestrangeloop.com/sponsors https://thestrangeloop.com/sponsors-page/prospectus
Total Sponsorship
70000
Total Ticket Sales
550000
Total Income
620000
Total Cost
@thoward
thoward / jsig_methods.md
Created April 3, 2013 06:26
Description of method specification vs type specification... concept for jsig.

Example 1

Param array must implement method reduce, with arity of 2.

// !array => !reduce(_,_)
function reduce(array, reducer, seed) {
  return array.reduce(reducer, seed);
}