Bo Frederiksen bofrede

View chef_solo_bootstrap.sh
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env bash
# Run this script, as root, on a prestine server, with:
# curl -L https://gist.github.com/bofrede/5607048/raw/chef_solo_bootstrap.sh | bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
echo 'gem: --no-rdoc --no-ri' > /etc/gemrc
ln -s /etc/gemrc ~/.gemrc
cd /tmp
curl --remote-name ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.gz
tar -xvzf ruby-1.9.3-p484.tar.gz
View html_export.rb
1 2 3 4 5 6 7 8 9 10
=begin
This script requires a Ruby intepeter to run:
http://rubyinstaller.org/
 
This script also requires Microsoft Windows and Microsoft Word to be installed.
 
A few libraries, used by this script:
 
HTML Sanitizer:
https://github.com/rgrove/sanitize/
View hack.sh
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env bash
 
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Download and auto-run with:
# $ curl -sL https://raw.github.com/gist/2108403/hack.sh | bash
#
# or download and prompt before change defaults:
View sl_gems_update.rb
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env ruby
puts "looking for the gems to upgrade..."
gem_info = Struct.new(:name, :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 << gem_info.new(name, version) unless bundle_info =~ /bundle x86_64/
end
View debug.js
1 2 3 4 5 6 7 8 9 10
function debug(aMsg) {
if (window.console) {
window.console.log(aMsg);
} else if (window.dump) {
window.dump(aMsg + '\n');
} else {
setTimeout(function () {
throw new Error('[debug] ' + aMsg);
}, 0);
}
View getLanguage.js
1 2 3 4 5 6 7 8
function getLanguage(elm) {
if (elm) {
return elm.getAttribute('lang') || getLanguage(elm.parentNode);
} else {
// TODO: find <meta http-equiv="Content-Language" content="da">
return null;
}
}
Something went wrong with that request. Please try again.