Skip to content

Instantly share code, notes, and snippets.

@erikroyall
erikroyall / print.js
Last active August 29, 2015 14:06
DOM print() function for... fun.
function print (o) {
var body = document.body
, ih = body.innerHTML;
body.innerHTML = ih ? ih + "<br/>" + o : o;
}
@erikroyall
erikroyall / my-style.js
Last active August 29, 2015 14:07
JavaScript and Semicolons
function Person (name, age) {
this.name = name;
this.age = age;
}
Person.prototype = {
getName: function () {
return this.name;
},
@erikroyall
erikroyall / lamp.sh
Created July 13, 2015 20:06
LAMP Stack Install Script Ubuntu 14.04
apt-get update
apt-get install apache2
apt-get install mysql-server php5-mysql
mysql_install_db
mysql_secure_installation
apt-get install php5 libapache2-mod-php5 php5-mcrypt
sed -i.bak s/DirectoryIndex index.html index.cgi index.pl index.php/DirectoryIndex index.php index.html index.cgi index.pl/g /etc/apache2/mods-enabled/dir.conf
service apache2 restart
apt-get install php5-cli
@erikroyall
erikroyall / base.css
Last active August 29, 2015 14:25
Minimal CSS
*, *::before, *::after { display: none !important; }
@erikroyall
erikroyall / init.sh
Last active August 29, 2015 14:27
Install Arc Theme, Numix-Circle theme and BAM!
# Uncomment if not using Ubuntu GNOME 15.04
# sudo apt-get install gnome-shell ubuntu-gnome-desktop -y
# Install Arc theme
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_15.04/ /' >> /etc/apt/sources.list.d/arc-theme.list" -y
wget http://download.opensuse.org/repositories/home:Horst3180/xUbuntu_15.04/Release.key
sudo apt-key add - < Release.key
sudo apt-get update
sudo apt-get install arc-theme -y
@erikroyall
erikroyall / backup.sh
Created April 15, 2015 13:40
Ubuntu Back Up Script
dpkg --get-selections > ~/Package.list
sudo cp -R /etc/apt/sources.list* ~/
sudo apt-key exportall > ~/Repo.keys
rsync --progress /home/`whoami` /path/to/user/profile/backup/here
<!doctype html>
<html lang="en"> <!-- Set the language attribute to the language of your web page -->>
<head>
<title>HTML5 Stiff Bones</title>
<meta charset="utf8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Sets width to device default -->
<!-- Note: Add "maximum-scale=1.0; user-scalable=0;" attributes to viewport meta tag to prevent user scaling -->
<meta name="description" content=""> <!-- Your site's description -->
<meta http-equiv="X-UA-Compatible" content="chrome=1"> <!-- Chrome Frame: HTML5 support for IE 7,8,9 versions -->
@erikroyall
erikroyall / gist:5538077
Last active December 17, 2015 02:48
JavaScript Private Properties and Methods in Object- Oriented Programming
window.erik = (function(){
var Erik, erik;
Erik = function() {
this.name = "Erik Royall";
this.age = 14;
};
return erik = {
// Public Method
getName: function() {
<pagination class='paginator' role='toolbar'>
<ul class='goto-pages'>
<li class='goto-search'>
<a href="#search" class="search-pages" title="Toggle Advanced Search">&#8981;</a>
</li>
<li class='goto-page'>
<a href="/admin/users?page=1" aria-disabled="true" class="first-page disabled" data-page="1" rel="first" title="Go to the first page">&#8676;</a>
</li>
<li class='goto-page'>
<a href="/admin/users?page=1" aria-disabled="true" class="prev-page disabled" data-page="1" rel="prev" title="Go to page 1">&#8672;</a>
sudo apt-get install vim plasma-nm git virtualbox steam bison gawk texinfo m4 g++ -y