Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Saucy
Saucy / CanDownload.js
Created December 1, 2015 20:03
Poor JavaScript example of LocalStorage
var CanDownload = localStorage.getItem('CanDownload');
// If localStorage variable 'CanDownload' isn't set yet, set it to true
if (CanDownload == null) {
localStorage.setItem('CanDownload', true);
}
// function called when button is clicked
// changes CanDownload status to false
function ChangeButton () {
* -------------------------------------------------------------------- *
T H E L E G E N D O F
##############
############## ######## ##### ###### ######
## #### ## ## ## ## ## #####
#### ## # # ## ## ## ## ###
#### #### ## ## ## ######
#### ## # # ## # ## ## ### ###
@Saucy
Saucy / verifyData.php
Created July 31, 2015 21:55
PHP - verify data types
<?php
function verifyData (array $fields, array $data, array $excludeFields = []) {
$array = [
'data' => [],
'debug' => []
];
foreach ($fields as $key => $value) {
// If key is in exclude: ignore field