Skip to content

Instantly share code, notes, and snippets.

Avatar

William Johnston will-in-wi

View GitHub Profile
@will-in-wi
will-in-wi / arw.xml
Created Jan 20, 2017
HTTPS enclosures to test validators
View arw.xml
<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
View keybase.md

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:

View Capfile
require "capistrano/setup"
require "capistrano/deploy"
View linear_algebra.rb
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 Apr 14, 2014
Output from console for Rails bug
View output
(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 Apr 14, 2014
Commands to expose Rails bug
View commands.rb
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 Aug 29, 2015
Demonstration of rails bug
View dungeon.rb
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 Jan 21, 2014
A test for starting at the right position on initial playback.
View soundmanager-position.html
<!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 Dec 13, 2013
Test case for PHP serialization bug
View serialization-test-case.php
<?php
class HelloWorld implements Serializable {
public $test;
public function __construct($str)
{
$this->test = $str;
}
@will-in-wi
will-in-wi / jquery-oas.js
Created Jun 10, 2013
An attempt to create a jquery plugin for async OAS usage. Unused.
View jquery-oas.js
(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') {
You can’t perform that action at this time.