Skip to content

Instantly share code, notes, and snippets.

View wholroyd's full-sized avatar

William Holroyd wholroyd

  • Google
  • Raleigh, NC
View GitHub Profile
<html>
<body onload="GetPromo()">
<SCRIPT LANGUAGE="JavaScript">
function GetPromo() {
var p = "4650";
var a = "47002";
var b = Math.random().toString().substr(3, 5);
var c = Math.random().toString().substr(7, 1);a
prompt("Enjoy your coupon! :)", a + b + p + c);
@wholroyd
wholroyd / gist:14a1d071497f10e77674
Last active August 29, 2015 14:09
Ubuntu Setup
# Add Oracle VirtualBox Repository
wget -q -O - http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian trusty non-free contrib" >> /etc/apt/sources.list.d/virtualbox.org.list'
# Add Google Chrome Repository
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
# Add Spotify Repository
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59
@wholroyd
wholroyd / gist:5db7471adcbdb92a2465
Last active August 29, 2015 14:08
Tomcat 7 and higher default config for users
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<user username="tomcat" password="tomcat" roles="tomcat,manager-gui,manager-status,manager-jmx,manager-script"/>
</tomcat-users>
@wholroyd
wholroyd / gist:6af0c13f5a8c64bc5670
Created October 15, 2014 14:36
Hashing a string into a Guid
// using System.Security.Cryptography
var str = “William Holroyd”;
var byt = Encoding.UTF8.GetBytes(str);
var hash = MD5.Create().ComputeHash(byt);
var guid = new Guid(hash);
// guid will always have a value of "ead7ab16-6d5b-0fa0-73b7-9fe85b675f83"
// for the input of “William Holroyd” provided above. This value will always