Skip to content

Instantly share code, notes, and snippets.

View waf's full-sized avatar

Will Fuqua waf

View GitHub Profile
@waf
waf / userChrome.css
Created March 23, 2011 18:43
Add some padding to the top of the firefox 4 tab bar, to allow for cross-monitor maximized window ripping
/*
* To install, add to your chrome/userChrome.css file in your firefox profile directory.
* Firefox profile directory is accessed by visiting "about:support" URI in firefox, then clicking "Open Containing Folder"
* You may need to create the directory and file.
*/
#navigator-toolbox[tabsontop="true"] #TabsToolbar {
padding-top:2px !important;
}
// see problem description and sample training CSVs here: https://gist.github.com/mathias-brandewinder/5558573
open System
open System.IO
let trainingPath = @"data\trainingsample.csv"
let validationPath = @"data\validationsample.csv"
type Example = { Label:int; Pixels:int[] }
@waf
waf / gist:6927966
Created October 11, 2013 00:45
F# MSDN hackery
// Learn more about F# at http://fsharp.net
// See the 'F# Tutorial' project for more help.
open FSharp.Data
open System.Net
type msdnSchema = JsonProvider<"./SampleJson/TechNet.json">
let downloader = new WebClient()
let toc = downloader.DownloadString("http://technet.microsoft.com/en-us/library/bb510741.aspx?toc=1")
let technet =
@waf
waf / gist:2a8002f2b09959de0b92
Last active August 29, 2015 14:16
GitHub Diff Toggle Bookmarklet
javascript:$(".file-header").click(function(e) { e.target.tagName === "DIV" && $(this).next(".blob-wrapper").toggle(); });
@waf
waf / gist:2a4f0140a4fd5491ef1b
Created May 8, 2015 02:18
Expiring TODOs in C#
namespace ExpiringTodos
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello");
Todo.By(2015, 04, 15, "A general hello is good enough, but we're including 'World' here for compatibility reasons.");
Console.WriteLine("World");
Console.ReadKey();
@waf
waf / gist:befaf6cc309dae69a2ef
Created May 27, 2015 12:19
connect to Slack API
//Cargo.toml:
[package]
name = "rustbot"
version = "0.1.0"
authors = ["wafuqua"]
[dependencies]
websocket = "~0.11.11"
hyper = "0.5.0"
@waf
waf / trello-sum-points.js
Last active August 29, 2015 14:26
Sum Trello Points
/*
* Reads trello card titles of the format "My Trello card (4)" where the number in parentheses
* is some number of sprint points. It sums up the points in list, and adds it to the list header.
*
* To use it as a bookmarklet on Trello, make a new bookmark, and set the bookmark URL to the
* below javascript, prefixed by "javascript:"
* Example Bookmark:
* Name: Sum Trello Points
* URL: javascript:(function() {var pointsIn...
*/
@waf
waf / Snippets.xml
Created September 10, 2015 04:05
VS2015 snippets for public and private methods
<!-- put this in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC#\Snippets\1033\Visual C#\pubm.snippet -->
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>pubm</Title>
<Shortcut>pubm</Shortcut>
<Description>Code snippet for public method</Description>
<Author>Will Fuqua</Author>
<SnippetTypes>
@waf
waf / websockets.fs
Created October 19, 2015 03:24
F# websocket work-in-progress
type WebSocketResponse =
| Close
| Message of msg : string
let rec readMessagePatternMatch (ws:WebSocket) : Async<WebSocketResponse> =
let buffer : byte array = Array.zeroCreate 1024
let utf8 = new UTF8Encoding()
async {
let! payload = ws.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None) |> Async.AwaitTask
return! match payload.MessageType with
@waf
waf / parse-word-list.py
Created January 3, 2016 17:34
Python 2 script that parses Stuart Jay Raj's "First Words to Learn - Enhanced Wordlist from Fluency Forever Multi Lang"
#!/usr/bin/env python
# Python 2 script that parses Stuart Jay Raj's "First Words to Learn - Enhanced Wordlist from Fluency Forever Multi Lang"
# Input file should be the JSON export here: https://spreadsheets.google.com/feeds/list/1GsNe8GVzgIuOeeEVBCcoIvxVMDO5xnEgGRr8EKtcSGI/1/public/basic?alt=json
# See original spreadsheet here: https://docs.google.com/spreadsheets/d/1GsNe8GVzgIuOeeEVBCcoIvxVMDO5xnEgGRr8EKtcSGI/edit#gid=884321509
import json
import codecs
QUESTION_LANGUAGE = 'thaith'