Skip to content

Instantly share code, notes, and snippets.

@tfausak
tfausak / wpm.py
Created December 24, 2011 21:01
Scrape application information from the Windows Phone Marketplace.
#!/usr/bin/env python
import BeautifulSoup
import cookielib
import re
import urllib2
def parse_rating(rating):
"""Parse a rating's class name and return it as a number.
@tfausak
tfausak / famigo-logo.html
Created January 20, 2012 00:33
The Famigo logo in HTML and CSS.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
html, body {
background: silver;
margin: 0;
@tfausak
tfausak / wp7-tile.html
Created February 3, 2012 04:39
Generate a tile-able page for Windows Phone 7.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="maximum-scale=1,minimum-scale=1,width=device-width" name="viewport">
<style>
body {
margin: 0;
@tfausak
tfausak / bootstrap-navbar-dropdown.html
Created March 15, 2012 19:16
Dropdown menu in Twitter Bootstrap's collapsed navbar
<!doctype html>
<html>
<head>
<meta charset=utf-8">
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet">
<style>
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@tfausak
tfausak / bootstrap.html
Created October 6, 2012 15:26
Shows Twitter Bootstrap's native support for uncollapsible dropdowns in versions >= 2.0.3.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<title>Bootstrap >= 2.0.3</title>
@tfausak
tfausak / circle-of-fifths.ly
Created November 16, 2012 02:44
Syntax highlighting for sheet music.
\version "2.16.1"
sharp = #(define-music-function (parser location note) (ly:music?) #{
\once \override NoteHead #'color = #(rgb-color .75 .25 0)
\once \override Stem #'color = #(rgb-color .75 .25 0)
#note
#})
flat = #(define-music-function (parser location note) (ly:music?) #{
\once \override NoteHead #'color = #(rgb-color 0 .25 .75)
@tfausak
tfausak / link-rot.rb
Created March 6, 2013 04:16
Check for link rot in a GitHub Pages repository.
@tfausak
tfausak / class-comparison.rb
Last active August 29, 2015 14:01
A rundown of the many ways to compare classes in Ruby.
# coding: utf-8
require 'rspec' # 2.14.1
# NOTE: "include?" and "included_modules" are for modules only.
CLASS_METHODS = %i(
!=
<
<=
<=>