Skip to content

Instantly share code, notes, and snippets.

View bookercodes's full-sized avatar

Alex Booker bookercodes

View GitHub Profile
@bookercodes
bookercodes / input-validation-with-node-and-express-validator.md
Last active August 29, 2015 14:21
I will put this on my blog once it is up and running.

In this tutorial I will teach you how to validate user input using an Express middleware module called express-validator.

express-validator is built on top of another open-source library called validator. validator is basically a library of validation functions. Some of it's popular functions include isEmail and isNumeric but you can see a full list here. express-validator makes all the functions in validator available in a way that works nicely with Node and Express.

###Installation

Installing express-validator is easy when you use npm. Just input the following command:

npm install express-validator
@bookercodes
bookercodes / reset.css
Last active December 7, 2015 11:02
Booker's reset.css. (I am building this as I go along and I only care about IE 9+.)
html,
body,
body div,
span,
object,
iframe,
h1,
h2,
h3,
h4,
@bookercodes
bookercodes / ubuntu-gnome.sh
Last active August 29, 2015 14:21
Ubuntu Gnome post-installation script by Booker.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo add-apt-repository ppa:mutate/ppa
sudo add-apt-repository -y ppa:ricotz/docky
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
sudo apt-get update
@bookercodes
bookercodes / pros-and-cons-of-gnome-in-my-view.md
Last active August 29, 2015 14:22
The pros and gons of the GNOME desktop environment, in my view...

#Pros and cons of GNOME, in my view

##Pros

  • Pretty customizable
  • Ubuntu...
  • Is it just me, or does Chrome font render really nice in GNOME?

##Cons:

  • GDM interface (login screen) is disgusting
@bookercodes
bookercodes / how-to-upgrade-to-gnome-3-16.md
Created May 28, 2015 17:16
I will put this on my blog once it is up and running.

#How to upgrade to GNOME 3.16

I have been using Ubuntu GNOME for the last week or so. It came pre-installed with GNOME 3.14 but that is not the latest version of GNOME, 3.16 is. In this short tutorial, I will teach you how to upgrade to GNOME 3.16. For a list of the new features, check out the release notes. I like GNOME 3.17 more than its predecessor but then again, I have only been using it for a couple of hours. I do not know how stable this is and I implore you to be cautious. That said, it does seem to work pretty good.

#A

sudo -s

apt-add-repository ppa:gnome3-team/gnome3

@bookercodes
bookercodes / how-to-solve-error-code-1175-in-mysql-workbench-6-2.md
Last active August 29, 2015 14:22
I will put this on my blog once it is up and running.

#How to Solve Error Code: 1175 in MySQL Workbench 6.2

Problem:

You want to perform an unconditional statement like

UPDATE dbo.Customers
SET approved = 1
@bookercodes
bookercodes / how-to-install-node-on-ubuntu-the-right-way.md
Last active August 29, 2015 14:22
I will put this on my blog once it is up and running.

#How to Install Node on Ubuntu, the Right Way

When I first started using Ubuntu a few months ago, I instinctively installed Node using these commands:

curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
sudo apt-get install nodejs

This is not the correct way to install Node. Installing Node this way leads to two problems in my experience:

@bookercodes
bookercodes / solutions.js
Last active August 29, 2015 14:22
These are my solutions to the "problems" chapter in Douglas Crockford's workshop entitled "Javascript the Good Parts" (http://www.pluralsight.com/courses/javascript-good-parts).
function identity(num) {
return num;
}
function add(num1, num2) {
return num1 + num2;
}
function mul(num1, num2) {
return num1 * num2;
[Desktop Entry]
Name=AutoVpn
Exec=/home/booker/connectVpn.sh
Type=Application
var time = "unix_timestamp here";
var then = moment.unix(time);
var by = moment(then).add({ days: 1 });
var expired = moment().isAfter(by);