Skip to content

Instantly share code, notes, and snippets.

View CarlosBonetti's full-sized avatar

Carlos Bonetti CarlosBonetti

View GitHub Profile
@CarlosBonetti
CarlosBonetti / regex-brute.html
Last active April 11, 2016 13:30
Regex Match by Brute Force
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script>
// ALWAYS put the test regex inside /^()$/.
// Example: /^(REGEX HERE)$/
@CarlosBonetti
CarlosBonetti / persistent-config.js
Last active August 29, 2015 14:03
Persistent Configurations for user browser-based options persistence
/**
* Store configurations in the localStorage (HTML5 compatible browsers only)
* so the user does not have to set basic options every time the browser are reloaded
*/
var PersistentConfig = {
/**
* The namespace prefix that will be applied to all storage keys, so all persistent config are kept on
* the same namespace
*/
@CarlosBonetti
CarlosBonetti / urlhash.js
Last active August 29, 2015 14:01
UrlHash
/**
* Provides method to dynamically read and modify url hash params like query strings (e.g. #year=2014&month=1)
*/
var UrlHash = {
/**
* Returns the full URL Hash, ommiting the # symbol
*/
getHash: function () {
return window.location.hash.replace("#", "");
},