Skip to content

Instantly share code, notes, and snippets.

View shgysk8zer0's full-sized avatar
💭
I may be slow to respond.

Chris Zuber shgysk8zer0

💭
I may be slow to respond.
View GitHub Profile
@shgysk8zer0
shgysk8zer0 / cc-validate.js
Created March 21, 2016 00:34
Validates a 16 digit credit card number
/**
* Validates a 16 digit credit card number
*
* @param string ccnum Any 16 digit number as a string
* @return boolean Whether or not it Validates
*/
function checkCCNum(ccnum) {
if (ccnum.length !== 16 || ! /^\d+$/.test(ccnum)) {
return false;
}
@shgysk8zer0
shgysk8zer0 / linkfilter.js
Created March 15, 2016 00:27
Quickly get info from <link>s,filtering unwanted `rel`s
function $(query) {
return Array.from(document.querySelectorAll(query));
}
$('link').filter(link = > ![
'icon',
'stylesheet',
'next',
'prev'
].some(rel => link.relList.contains(rel))).reduce((links, link) => {
@shgysk8zer0
shgysk8zer0 / openpgp.txt
Created March 2, 2016 05:17
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:c8858e4f4633f3e5f364b25a539986bb2e23d409]
@shgysk8zer0
shgysk8zer0 / namespacedfunction.php
Created February 29, 2016 05:01
NamespacedFunctions.php
<?php
/**
* @author Chris Zuber
* @copyright 2016, Chris Zuber
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0)
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
@shgysk8zer0
shgysk8zer0 / .babelrc
Last active October 10, 2023 07:23
PHP URLSearchParams class
{
"presets": ["es2015"],
"sourceMaps": true,
"only": "*.js",
"compact": true,
"comments": false
}
@shgysk8zer0
shgysk8zer0 / polyfills.es6
Created January 29, 2016 09:08
polyfill-module.es6
export {default as dePrefix} from './deprefixer.es6';
export * from './polyfills/array/modules.es6';
export * from './polyfills/string/modules.es6';
export * from './polyfills/element/modules.es6';
export * from './polyfills/css/modules.es6';
export * from './polyfills/promises.es6';
export * from './polyfills/fetch.es6';
export * from './polyfills/mutationobserver.es6';
@shgysk8zer0
shgysk8zer0 / .eslintignore
Last active May 7, 2018 15:09
Testing polyfill for URLSearchParams
.eslintrc
.eslintignore
.travis.yml
zq.js
README.md
polyfills.js
@shgysk8zer0
shgysk8zer0 / emoji.php
Created November 3, 2015 05:29
Sample
<?php
$timer = new \shgysk8zer0\Core\Timer();
$console = new \shgysk8zer0\Core\Console();
$header = new \shgysk8zer0\Core\Headers();
$html = new \shgysk8zer0\DOM\HTML();
$svg = new \shgysk8zer0\DOM\SVG();
$unicode = new \shgysk8zer0\Core\Unicode();
$chars = new \shgysk8zer0\Core\ArrayObject([
'BLACK_SUN_WITH_RAYS',
'WHITE_STAR',
@shgysk8zer0
shgysk8zer0 / miscellaneous.json
Created October 13, 2015 06:26
Miscellaneous Unicode chars as JSON
{
"BLACK_SUN_WITH_RAYS": {
"char": "\u2600",
"dec": 9728,
"hex": 2600,
"entity": ""
},
"CLOUD": {
"char": "\u2601",
"dec": 9729,
@shgysk8zer0
shgysk8zer0 / array_loop.es6
Last active August 31, 2015 18:03
Array.loop using Generators
Array.prototype.loop = function* (times = Infinity) {
while (times-- > 0) {
for (let el of this) {
yield el;
}
}
};