Skip to content

Instantly share code, notes, and snippets.

@tfausak
tfausak / wpm.py
Created Dec 24, 2011
Scrape application information from the Windows Phone Marketplace.
View wpm.py
#!/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 Jan 20, 2012
The Famigo logo in HTML and CSS.
View famigo-logo.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
html, body {
background: silver;
margin: 0;
@tfausak
tfausak / wp7-tile.html
Created Feb 3, 2012
Generate a tile-able page for Windows Phone 7.
View wp7-tile.html
<!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 Mar 15, 2012
Dropdown menu in Twitter Bootstrap's collapsed navbar
View bootstrap-navbar-dropdown.html
<!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>
View ios-8-web-app.html
<!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 Oct 6, 2012
Shows Twitter Bootstrap's native support for uncollapsible dropdowns in versions >= 2.0.3.
View bootstrap.html
<!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 Nov 16, 2012
Syntax highlighting for sheet music.
View circle-of-fifths.ly
\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 Mar 6, 2013
Check for link rot in a GitHub Pages repository.
View link-rot.rb
@tfausak
tfausak / class-comparison.rb
Last active Aug 29, 2015
A rundown of the many ways to compare classes in Ruby.
View class-comparison.rb
# coding: utf-8
require 'rspec' # 2.14.1
# NOTE: "include?" and "included_modules" are for modules only.
CLASS_METHODS = %i(
!=
<
<=
<=>