Skip to content

Instantly share code, notes, and snippets.

@shanecp
shanecp / 0_reuse_code.js
Created March 12, 2016 12:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@shanecp
shanecp / gulpfile.js
Last active January 9, 2016 03:29
Laravel 5 Elixir with LiveReload custom task
// require the file
require('./gulp_tasks/watch');
// Call the new task in Laravel Elixir file
elixir(function(mix)) {
mix.watch();
});
@shanecp
shanecp / index.js
Last active August 29, 2015 14:10 — forked from stinoga/index.js
Replace a parameter in a query string
function paramReplace(name, string, value) {
// Find the param with regex
// Grab the first character in the returned string (should be ? or &)
// Replace our href string with our new value, passing on the name and delimeter
var re = new RegExp("[\\?&]" + name + "=([^&#]*)");
var matches = re.exec(string);
var newString;
if (matches === null) {