This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
require 'fileutils' | |
Bundler.require | |
GHOST_DIR = ENV['GHOST_HOME'] || '<your_ghost_folder>' | |
THEME = 'casper' | |
namespace :blog do | |
desc 'Upgrades Ghost using given file' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Homebrew fix 1 - osxfuse dylibs | |
# | |
# original solutions: https://gist.github.com/aaronzirbes/3239033 | |
# https://gist.github.com/trinitronx/5437061 | |
# | |
# Fixes the following: | |
# | |
# > Warning: Unbrewed dylibs were found in /usr/local/lib. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Shortcuttr - generates executable shortcuts | |
# | |
require 'fileutils' | |
SCRIPT = File.join ENV['HOME'], 'github/ruby-scripts/system/bin', ARGV.first.to_s | |
File.open SCRIPT, 'w', 0755 do |f| | |
f.puts '#!/usr/bin/bash' | |
f.puts '# This executable shortcut was generated by Stephen Benner, a truly lazy programmer' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# CLI tool for locating and removing a Homebrew installation | |
# http://brew.sh/ | |
# | |
# Copyright (C) 2014 Stephen C. Benner | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fname_incr(fname) | |
!File.exists?(fname) ? | |
fname : | |
/([0-9]+)\./.match(fname) ? | |
fname_incr(fname.sub(/([0-9]+)/) { |m| (m.to_i+1).to_s }) : | |
fname_incr(fname.sub(/[^\.]*/) { |m| m+'1' }) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 ;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nuke Ruby! | |
rm -rf ~/.gem | |
rm -rf ~/.rubies | |
# Prerequisites for Mac OSX installation | |
# | |
# Make sure Xcode or the command line tools are installed | |
# This one's up to you: https://github.com/kennethreitz/osx-gcc-installer#readme | |
# | |
# Install Homebrew if not installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bower configuration | |
# | |
# Official docs at: http://bower.io/docs/config/ | |
# Last updated at: 2014-08-14 | |
# | |
# Config is obtained by merging the following, in given order: | |
# - CLI args via -config | |
# - Environment variables | |
# - Local .bowerrc located in the current working directory | |
# - All .bowerrc files upwards the directory tree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |