Skip to content

Instantly share code, notes, and snippets.

View will-in-wi's full-sized avatar

William Johnston will-in-wi

View GitHub Profile
@will-in-wi
will-in-wi / arw.xml
Created January 20, 2017 18:37
HTTPS enclosures to test validators
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>American RadioWorks</title>
<link>http://www.americanradioworks.org/</link>
<description>American Public Media's American RadioWorks creates documentaries, series projects, and investigative reports for the public radio system and the Internet.We have a special interest in exploring the people, ideas, and innovations that are changing education in the 21st century. We also examine critical issues in civil society, health care, the environment, business and economics.@amradioworks</description>
<language>en-us</language>
<copyright>Copyright 2017 American Public Media</copyright>
<ttl>60</ttl>
<itunes:author>American RadioWorks</itunes:author>
<itunes:summary>American Public Media's American RadioWorks creates documentaries, series projects, and investigative reports for the public radio system and the Internet.We have a special interest in ex

Keybase proof

I hereby claim:

  • I am will-in-wi on github.
  • I am willinwi (https://keybase.io/willinwi) on keybase.
  • I have a public key ASDmHXlBeEB7URpkGmjRNdy8dTtc6dV3SV4Evr20jmosugo

To claim this, I am signing this object:

require "capistrano/setup"
require "capistrano/deploy"
require 'pry'
# A linear algebra matrix row.
class Row
def initialize(arr)
@arr = arr.map(&:to_r)
end
def map_with_index
arr = @arr.map.with_index do |val, i|
@will-in-wi
will-in-wi / output
Created April 14, 2014 22:22
Output from console for Rails bug
(0.1ms) begin transaction
SQL (0.6ms) INSERT INTO "wizards" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-04-14 22:18:36.904177"], ["name", "Merlin"], ["updated_at", "2014-04-14 22:18:36.904177"]]
SQL (0.2ms) INSERT INTO "dungeon_wizards" ("created_at", "dungeon_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-04-14 22:18:36.906145"], ["dungeon_id", 2], ["updated_at", "2014-04-14 22:18:36.906145"]]
SQL (0.2ms) UPDATE "dungeon_wizards" SET "updated_at" = ?, "wizard_id" = ? WHERE "dungeon_wizards"."id" = 1 [["updated_at", "2014-04-14 22:18:36.907402"], ["wizard_id", 1]]
(1.3ms) commit transaction
@will-in-wi
will-in-wi / commands.rb
Created April 14, 2014 22:22
Commands to expose Rails bug
d = Dungeon.create name: 'The Pit of Dispair'
w = Wizard.new name: 'Merlin'
w.dungeons << d
w.save
@will-in-wi
will-in-wi / dungeon.rb
Last active August 29, 2015 13:59
Demonstration of rails bug
class Dungeon < ActiveRecord::Base
has_many :wizards, through: :dungeon_wizard
has_many :dungeon_wizard
end
@will-in-wi
will-in-wi / soundmanager-position.html
Created January 21, 2014 16:00
A test for starting at the right position on initial playback.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test time to duration</title>
<meta name="viewport" content="width=device-width, user-scalable=no" />
<script src="script/soundmanager2.js"></script>
@will-in-wi
will-in-wi / serialization-test-case.php
Created December 13, 2013 21:29
Test case for PHP serialization bug
<?php
class HelloWorld implements Serializable {
public $test;
public function __construct($str)
{
$this->test = $str;
}
@will-in-wi
will-in-wi / jquery-oas.js
Created June 10, 2013 19:40
An attempt to create a jquery plugin for async OAS usage. Unused.
(function($){
// Properties is an object with the following keys:
// listpos (required) A comma delimited list (no spaces) of the used positions on this page.
// sitepage (optional) The page to be sent for the ad server. Defaults to the current page.
//
// Position is defined by the data-oas-pos attribute. The ad will be inserted inside.
$.fn.oas = function(properties) {
// Set default properties and fail on required properties.
if (typeof(properties.sitepage) === 'undefined') {