Skip to content

Instantly share code, notes, and snippets.

@EvanWillms
EvanWillms / replace_text_with_url_param.js
Created May 8, 2012 23:58 — forked from cgilchrist/replace_text_with_url_param.js
Replace some text on your page with the value of a URL parameter
<script type="text/javascript">
var getUrlParams = function() {
var params = {}, hash;
var hashes = decodeURI(window.location.href).replace(/\+/g," ").slice(window.location.href.indexOf('?') + 1).split('&');
for (var i=0; i<hashes.length; i++) {
hash = hashes[i].split('=');
params[hash[0]] = hash[1];
}
return params;
};
@EvanWillms
EvanWillms / ubuntu-11.10-gems.erb
Created March 13, 2012 22:25 — forked from kashif/ubuntu-11.10-gems.erb
Chef bootstrap With rvm and ruby 1.9.3 on ubuntu 11.10
bash -c '
<% if knife_config[:bootstrap_proxy] -%>
(
cat <<'EOP'
<%= "proxy = #{knife_config[:bootstrap_proxy]}" %>
EOP
) > ~/.curlrc
<% end -%>
if [ ! -f /usr/bin/chef-client ]; then