Skip to content

Instantly share code, notes, and snippets.

View bigfive's full-sized avatar

Jonathan Williams (jdub) bigfive

  • Envato
  • Perth, Australia
View GitHub Profile
@bigfive
bigfive / database.yml
Created April 1, 2014 03:53
Magnum CI example db config
core: &core
adapter: postgresql
host: 127.0.0.1
username: postgres
database: magnum<%= ENV['TEST_ENV_NUMBER'] %>
development:
<<: *core
test:
<<: *core
@bigfive
bigfive / scss_color_extractor.rb
Last active August 29, 2015 14:03
Genreate report on possible duplicate and missing scss color vars
require 'scss_lint'
module SassExtractor
mattr_accessor :color_var_nodes
mattr_accessor :color_nodes
self.color_var_nodes = []
self.color_nodes = []
module Vistors
class VariableGatherer < SCSSLint::Linter
@bigfive
bigfive / gist:68719b29456213e5d244
Last active August 29, 2015 14:07
Push release/hotfix branch to origin remote. Checks if any orphan commits on target
function fpushrel () {
# Assertion: At least one arg
if [ -z $1 ]; then
echo "ERROR: Please provide a branch to push (eg staging/production)"; return
fi
# Assertion: No uncommited changes
if ! [ $(git status -s | wc -l) -eq 0 ]; then
echo "ERROR: You have changes that have not been committed"; return
fi
@bigfive
bigfive / _manifest.html.erb
Created December 1, 2014 04:52
Rails 3 javascript asset path method
<script>
<% if File.exists? Rails.root.join('public/assets/manifest.yml') %>
window.railsAssetManifest = <%= raw YAML.load_file(Rails.root.join('public/assets/manifest.yml')).to_json %>;
<% else %>
window.railsAssetManifest = {};
<% end %>
window.railsAssetPath = function(assetName){
result = (!!window.railsAssetManifest[assetName] ? window.railsAssetManifest[assetName] : assetName);
return ('/assets/' + result);