View macfix4-disable-crash-reporter.rb
#!/usr/bin/env ruby | |
# | |
# Mac fix 4 - Disable CrashReporter | |
# | |
# CrashReporter is a daemon that monitors for crashes and generates a report (duh) when they occur. | |
# If an application (such as Finder) become stuck in an infinite crash loop, then sometimes it's | |
# desirable to just turn off CrashReporter entirely, as it will continually generate processes in | |
# the background which spew errors and logs, resulting in massive overhead to your system resources. | |
# | |
# DIAGNOSING: |
View yaml-aliases-groups.rb
#!/usr/bin/env ruby | |
# | |
# If you've got a collection of Bash aliases that just keeps growing... Consider using YAML! | |
# | |
# This version is designed to parse aliases organized under named groups in the YAML | |
# file, so the first level of mappings are purely semantic, and are used to keep the | |
# data organized and well-documented. | |
# | |
require 'pathname' | |
require 'yaml' |
View yaml-env-vars-groups.rb
#!/usr/bin/env ruby | |
# | |
# This bit of code lets you define Environment variables in your shell via a YAML file. | |
# It works by composing Bash commands from the parsed data, meant to be executed within | |
# a Bash environment, which will export the variables just as in a regular Bash profile. | |
# This is accomplished by executing this script via the Bash substitution syntax $(...) | |
# which returns the output of evaluating whatever is inside the parenthesis, which in | |
# the case of this script would be appropriate 'export' commands that are run by Bash. | |
# | |
# This version is designed to parse aliases organized under named groups in the YAML |
View _google-analytics.slim
/ Official Google Analytics tracking code (updated 2014-10-23) | |
/ | |
/ @option [String] google_analytics_key GA key in a format similar to: 'UA-XXXXXXXX-X' | |
/ | |
- if google_analytics_key | |
javascript: | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); |
View html5bp-middleman.slim
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' |
View html5-boilerplate-4.3.0.slim
/ 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 |
View html5bp-lean.slim
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" |
View google-fonts.rb
# 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 |
View macfix1-install-nokogiri.rb
#!/usr/bin/env ruby | |
# | |
# Mac fix 1 - Install the Nokogiri gem on Mac OS 10.9 Mavericks | |
# | |
# Usage: to configure and install using Bundler, pass in 'bundle' as an argument to the script. | |
# | |
# Nokogiri works at a very low level, so it has many issues on various platforms. | |
# As a result, the command `install gem nokogiri` often will fail. This fix is for | |
# errors involving 'libiconv', such as the following one I encountered: | |
# |