Skip to content

Instantly share code, notes, and snippets.

@SteveBenner
SteveBenner / dl-tatw.rb
Created May 17, 2015 16:48
Web scraper that downloads archived episodes of 'Trance Around The World' podcast
#!/usr/bin/env ruby
#
# This is a web scraper which downloads mp3 files from the TATW web archives.
#
# Usage: run this script and pass it an episode range to download via arguments
#
# Dependencies: requires 'aria2' to be installed (uses the CLI tool 'aria2c')
#
require 'pathname'
require 'colorize' # Use of this gem is optional; it makes the output prettier
@SteveBenner
SteveBenner / README-Template.md
Created July 28, 2017 04:57 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@SteveBenner
SteveBenner / git-helpers.bash
Last active November 30, 2016 06:02
Bash functions for managing Git
#
# FUNCTIONS
#
# Test the first argument of a command for a git host identifier (aliases configured in ssh-config)
is_git_host() {
case "$1" in
'gh') host='github-personal'
user='SteveBenner'
true ;;
@SteveBenner
SteveBenner / google-fonts.rb
Last active October 5, 2016 14:27
Helper [tag] that loads Google fonts into your webpage via the web API
# This tag allows you to load one or more font families into your page via the Google Fonts API
#
# @see https://developers.google.com/fonts/ The Web Fonts Project
# @see http://www.google.com/fonts Google Fonts Repository
#
# @note This tag MUST be placed in the <head></head> section of your webpage.
#
# @overload google_fonts(family)
# Load a single font family in the default 'normal' style
# @param [String, Symbol] family Name of a single font family to load
@SteveBenner
SteveBenner / html5bp-lean.slim
Created September 25, 2014 11:12
Slim template - Lean version of HTML5 Boilerplate
ruby:
google_analytics_key = 'UA-XXXXXXXX-X' # your key may have more or less characters
page_title = ''
page_description = ''
doctype html
== conditional_html_tags_for_ie_versions 7..8, lang: 'en'
head
meta charset="utf-8"
meta http-equiv="X-UA-Compatible" content="IE=edge; chrome=1"
/ This partial allows you to render the Coderwall badges of specified user
/
ruby:
username = 'your-coderwall-username'
orientation = 'horizontal' # can be 'vertical' or 'horizontal'
/ Place the following tags in the HEAD section of your web page (omit jQuery if already present, of course)
link href="http://coderwall.com/stylesheets/jquery.coderwall.css" media="all" rel="stylesheet" type="text/css"
script src="https://code.jquery.com/jquery-2.1.1.min.js"
script src="http://coderwall.com/javascripts/jquery.coderwall.js"
@SteveBenner
SteveBenner / flatdoc.slim
Last active October 5, 2016 14:27
Slim template for Flatdoc
/ This is a Slim recreation of the Flatdoc example template provided here:
/ https://raw.githubusercontent.com/rstacruz/flatdoc/gh-pages/templates/template.html
/
/ Flatdoc is a simple way to generate a documentation page from Markdown
/ More info is available on their website: http://ricostacruz.com/flatdoc/
/
/ The main alterations noticeable in this version of the template are:
/ - Emphasis is placed on using variables and interpolation often, key advantages of Slim
/ - The GitHub button links have been replaced with a Web Component version, which I
find to be superior to using an iFrame. Just uncomment the original code to revert.
@SteveBenner
SteveBenner / html5bp-middleman.slim
Last active October 5, 2016 14:27
Slim template - Middleman layout based off HTML5 Boilerplate
doctype html
== conditional_html_tags_for_ie_versions 7..8, lang: 'en'
head
meta charset="utf-8"
meta http-equiv="X-UA-Compatible" content="IE=edge; chrome=1"
title = page_title
meta name="description" content=page_description
meta name="viewport" content="width=device-width, initial-scale=1"
/ Normalize - front end standardization
= stylesheet_link_tag 'vendor/normalize'
@SteveBenner
SteveBenner / html5-boilerplate-4.3.0.slim
Created September 25, 2014 15:06
Slim template - HTML5 Boilerplate index page
/ This template produces an EXACT replica of the `index.html` file found in HTML5 Boilerplate v4.3.0
/ The official distribution is located at: https://github.com/h5bp/html5-boilerplate/blob/v4.3.0/index.html
/
/ For a more elegant way to generate the HTML tags within IE conditional comments, see the abstraction
/ in my gist at: https://gist.github.com/SteveBenner/a71f41e175f135b7d69b
/
doctype html
/ The min and max values of the version range actually represent all values below or above the limit
- ie_versions = 6..9 # A minimum value of 6 for example, translates into 'less than 7'
- for version in ie_versions
@SteveBenner
SteveBenner / sitemap.xml.slim
Last active April 24, 2016 12:01 — forked from ls-lukebowerman/sitemap.xml.erb
Slim template - generates a sitemap for Middleman
- pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) }
doctype xml
urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
- pages.each do |p|
url
loc "http://www.YOUR_WEBSITE_URL/#{p.destination_path.gsub('/index.html','')}"
lastmod = Date.today.to_time.iso8601
changefreq = p.data.changefreq || 'weekly'
priority = p.data.priority || '0.5'