Skip to content

Instantly share code, notes, and snippets.

@remcoder
remcoder / QueryString.js
Created April 18, 2012 14:39
access querystring params from javascript
// adapted from: http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript
// wrapped it in a module and only exposing a getter function make the datastructure immutable
// usage: var bla = QueryString.get('loginEnabled')
var QueryString = (function () {
var urlParams = {};
var e,
a = /\+/g, // Regex for replacing addition symbol with a space
r = /([^&=]+)=?([^&]*)/g,
d = function (s) { return decodeURIComponent(s.replace(a, " ")); },
@fideloper
fideloper / install_mysql.sh
Last active July 1, 2020 10:13
instal mysql5.7 non-interactive on ubuntu 14.04
#!/usr/bin/env bash
# This is assumed to be run as root or with sudo
export DEBIAN_FRONTEND=noninteractive
# Import MySQL 5.7 Key
# gpg: key 5072E1F5: public key "MySQL Release Engineering <[email protected]>" imported
apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 5072E1F5
echo "deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7" | tee -a /etc/apt/sources.list.d/mysql.list