Skip to content

Instantly share code, notes, and snippets.

View jeremytarpley's full-sized avatar

Jeremy Tarpley jeremytarpley

View GitHub Profile
@jeremytarpley
jeremytarpley / .vimrc
Last active October 9, 2023 20:51
vimrc
" Configuration file for vim
set modelines=0 " CVE-2007-2438
"" Encoding
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8
set ttyfast
" Normally we use vim-extensions. If you want true vi-compatibility
@jeremytarpley
jeremytarpley / simple-clean-variable.php
Last active March 24, 2018 15:15
php to strip out anything that isn't a letter, number or minus
<?php
/*
Had a need to go a little further than PHP's sanitize filters would get me. Basically wanted a simple white list.
ex: filter_var ($variable, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH) - still leaves a bunch of caracters I don't want in my variable
the preg_replace below will remove anything that isn't a letter, number or minus
*/
$clean_var = preg_replace('/[^a-z0-9-]/', '', $variable);
?>
@jeremytarpley
jeremytarpley / 0_reuse_code.js
Created March 10, 2014 20:27
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