This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="state"> | |
<option value="AL">Alabama</option> | |
<option value="AK">Alaska</option> | |
<option value="AZ">Arizona</option> | |
<option value="AR">Arkansas</option> | |
<option value="CA">California</option> | |
<option value="CO">Colorado</option> | |
<option value="CT">Connecticut</option> | |
<option value="DE">Delaware</option> | |
<option value="DC">District Of Columbia</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gulpfile.js | |
// Heavily inspired by Mike Valstar's solution: | |
// http://mikevalstar.com/post/fast-gulp-browserify-babelify-watchify-react-build/ | |
"use strict"; | |
const gulp = require( 'gulp' ); | |
const browserify = require( 'browserify' ); | |
const babelify = require( 'babelify' ); | |
const uglifyify = require( 'uglifyify' ); | |
const watchify = require( 'watchify' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addEventListenerOnce(node, event, callback) { | |
function listenOnce() { | |
node.removeEventListener(event, fnOnce) | |
return callback.apply(null, arguments) | |
} | |
node.addEventListener(event, fnOnce) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyRegEx { | |
static email(){ | |
return /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; | |
} | |
static ssn(){ | |
return /^(?!000|666|900|999)(\d{3})-?(?!00)(\d{2})-?(?!0000)(\d{4})$/; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function debounce( func, wait, immediate ) { | |
let timeout; | |
let args; | |
let context; | |
let timestamp; | |
let result; | |
const now = Date.now || () => new Date().getTime(); | |
const later = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function ( ) { | |
'use strict'; | |
function Countdown( endDate, elSelector ) { | |
if ( endDate instanceof Date ) { | |
this.countdownDate = endDate.getTime( ); | |
} else { | |
this.countdownDate = new Date( endDate ).getTime( ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SafeArray implements JsonSerializable, ArrayAccess { | |
/** | |
* @var array | |
*/ | |
private $data; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function extractAllObjectPropsToArray( $object ) | |
{ | |
$properties = []; | |
$reflection = new ReflectionClass( $object ); | |
foreach ( $reflection->getProperties() as $property ) | |
{ | |
$property->setAccessible( TRUE ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ResponseReflector { | |
/** | |
* @param \net\authorize\api\contract\v1\ANetApiResponseType $responseType | |
* | |
* @return array | |
*/ | |
public static function extractANetResponsePropsToArray( \net\authorize\api\contract\v1\ANetApiResponseType $responseType ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.md-drop-shadow-lt { | |
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); | |
} | |
.md-drop-shadow { | |
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); | |
} | |
.md-drop-shadow-heavy { | |
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23); |