Skip to content

Instantly share code, notes, and snippets.

@bxmas13
bxmas13 / getparam.js
Last active February 14, 2017 20:47 — forked from varemenos/getparam.js
JQuery - GET URL Parameter value
// Given a query string "?to=email&why=because&first=John&Last=smith"
// getUrlVar("to") will return "email"
// getUrlVar("last") will return "smith"
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && decodeURI(result[1]) || "";
}
@bxmas13
bxmas13 / newvhost.sh
Last active June 11, 2019 19:09 — forked from mattmezza/vhost.sh
bash script to create virtual host vhost with apache httpd and CentOs 7
#!/bin/bash
# This script is used for create virtual hosts on CentOs.
# Created by alexnogard from http://alexnogard.com
# Improved by mattmezza from http://you.canmakethat.com
# Further Improved by bxmas13 from https://brianchristmas.com
# Feel free to modify it
# PARAMETERS
#
# $usr - User
# $dir - directory of web files