View config-initializers-solidus_fixes.rb
require 'spree/product'
require 'solidus_globalize/fallbacks'
module Spree
Product.class_eval do
# Fix for method not found find_by_slug
def self.find_by_slug(slug)
translation = Product::Translation.find_by_slug(slug)
View gist:9846e0c1d063bdf9b44e
Windows Registry Editor Version 5.00
#!/usr/bin/env bash
# Run this script, as root, on a prestine server, with:
# sudo su
# curl -L | bash
apt-get -y update
apt-get -y install software-properties-common lib64readline-gplv2-dev
apt-get -y install build-essential zlib1g-dev lib64z1-dev libssl-dev libyaml-dev libxml2-dev libxslt1-dev libffi-dev
echo 'gem: --no-rdoc --no-ri' > /etc/gemrc
ln -s /etc/gemrc ~/.gemrc
add-apt-repository ppa:brightbox/ruby-ng
View html_export.rb
This script requires a Ruby intepeter to run:
This script also requires Microsoft Windows and Microsoft Word to be installed.
A few libraries, used by this script:
HTML Sanitizer:
#!/usr/bin/env bash
# This is a script with usefull tips taken from:
# Download and auto-run with:
# $ curl -sL | bash
# or download and prompt before change defaults:
View sl_gems_update.rb
#!/usr/bin/env ruby
puts "looking for the gems to upgrade..."
gem_info =, :version)
to_reinstall = []
Dir.glob('/Library/Ruby/Gems/**/*.bundle').map do |path|
path =~ /.*1.8\/gems\/(.*)-(.*?)\/.*/
name, version = $1, $2
bundle_info = `file path`
to_reinstall <<, version) unless bundle_info =~ /bundle x86_64/
View debug.js
function debug(aMsg) {
if (window.console) {
} else if (window.dump) {
window.dump(aMsg + '\n');
} else {
setTimeout(function () {
throw new Error('[debug] ' + aMsg);
}, 0);
View getLanguage.js
function getLanguage(elm) {
if (elm) {
return elm.getAttribute('lang') || getLanguage(elm.parentNode);
} else {
// TODO: find <meta http-equiv="Content-Language" content="da">
return null;