View sass-convert-dir.rb
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
DIR = '<project-root>' | |
files = Dir.glob("#{DIR}/**/*.scss") | |
files.each { |f| `sass-convert #{f} #{f.sub(/\.scss/, '.sass')}` unless File.exist?(f.sub(/\.scss/, '.sass')) } | |
# one-liner for CLI use | |
# ruby -e "Dir.glob('<project-root>/**/*.scss').each { |f| `sass-convert #{f} #{f.sub(/\.scss/, '.sass')}` unless File.exist?(f.sub(/\.scss/, '.sass')) }" |
View github-readme-markdown-styles.sass
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
// Github markdown styles | |
$h1-grey: #dddddd | |
$h2-grey: #eeeeee | |
$header-black: #333333 | |
// placeholders | |
%hover-link | |
background: url(data:image/png) no-repeat 10px center | |
text-decoration: none |
View _disqus.slim
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
/ Integrate Disqus comments into your site with this widget (adheres to official API and config spec) | |
/ | |
/ @see https://help.disqus.com/customer/portal/articles/1104788-web-integration Official web integration docs | |
/ @see https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables Configuration docs | |
/ | |
/ @local [Hash{Symbol => String}] disqus Key/value pairs corresponding to the Disqus JS configuration variables | |
/ @option disqus [String] shortname Unique identifier for your forum website registered on Disqus.com (REQUIRED) | |
/ @option disqus [String] identifier A String or Integer value which identifies the current web page thread | |
/ @option disqus [String] title Title of the current page; defaults to value of HTML `title` element | |
/ @option disqus [String] url URL of the current page; defaults to `window.location.href` |
View ghost-upgrade.rake
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' |
View shortcuttr.rb
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' |
View fname_incr.rb
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 |
View nuke-ruby.bash
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 |
View .bowerrc.yml
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 |
View _google-analytics.slim
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
/ 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 common.loading.css
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
body.loading:after { | |
/* with no content, nothing is rendered */ | |
content: ""; | |
position: fixed; | |
/* element stretched to cover during rotation an aspect ratio up to 1/10 */ | |
top: -500%; | |
left: -500%; | |
right: -500%; | |
bottom: -500%; | |
z-index: 9999; |
OlderNewer