Skip to content

Instantly share code, notes, and snippets.

View yeurch's full-sized avatar

Richard Fawcett yeurch

View GitHub Profile
@yeurch
yeurch / Morse.ino
Last active January 29, 2016 09:50
Simple program for the Arduino Uno to take user input and flash an LED in Morse code.
typedef struct {
char c;
char[6] pulses;
} letter;
boolean bUseOnBoardLED = true;
int ledPin = bUseOnBoardLED ? 13 : 9;
letter* letters;
int ltr_cnt = 0;
@yeurch
yeurch / gist:5745113
Created June 9, 2013 20:37
I found this select list of 177 (!) options for title on a university's charitable giving page. Common options like Mr, Mrs, Miss aren't even at the top. Usability fail!
<select name="PC11032$ctl00$PersonalInfoShippingAddress$ddTitle" id="PC11032_ctl00_PersonalInfoShippingAddress_ddTitle" class="BBFormSelectList DonationCaptureSelectList">
<option selected="selected" value=""></option>
<option value="12668">Abbot</option>
<option value="4647">Admiral</option>
<option value="6576">Advocate</option>
<option value="5181">Air Commodore</option>
<option value="6085">Air Marshal</option>
<option value="5127">Air Vice-Marshal</option>
<option value="4649">Ambassador</option>
<option value="5329">Archbishop</option>
@yeurch
yeurch / gist:5261896
Last active December 15, 2015 12:39
Running a set of statements in an Entity Framework migration (this particular example is in relation to https://github.com/davidfowl/JabbR/issues/751)
using System.Data.Entity.Migrations;
using System;
public partial class ChangeIndexingOnChatMessages : DbMigration
{
private static readonly string[] Statements = new[] {
"alter table dbo.ChatMessages drop constraint PK_ChatMessages",
"create clustered index CX_ChatMessages_When on dbo.ChatMessages ([When])",
"alter table dbo.ChatMessages add constraint PK_ChatMessages primary key nonclustered ([Key])"
};
@yeurch
yeurch / uri.js
Created April 23, 2012 23:24 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"