This file contains hidden or 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
.checkbox-input | |
display: block | |
position: relative | |
background-color: rgba(#000, 0.2) | |
border-bottom: 1px solid rgba(#fff, 0.2) | |
overflow: hidden | |
&__input | |
display: none |
This file contains hidden or 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
<div class="checkbox-input"> | |
<input class="checkbox-input__input" id="card-default" name="card-default" type="checkbox" ng-model="creditCard.default"> | |
<label class="checkbox-input__label" for="card-default">Make this my default card</label> | |
</div> |
This file contains hidden or 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
/** | |
* Explode array component string into usable array of properties, i.e. | |
* 'field[subfield1][subfield2][subfield3]' => | |
* ["field", "subfield1", "subfield2", "subfield3"] | |
* | |
* @param {String} string String of fields | |
* | |
* @return {Array} Returns array of field properties | |
*/ | |
function arrayStringToProperties ( string ) { |
This file contains hidden or 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
Loaded hooks (in the order they are loaded): | |
hook:moduleloader:loaded | |
hook:userconfig:loaded | |
hook:userhooks:loaded | |
hook:logger:loaded | |
hook:request:loaded | |
hook:blueprints:loaded | |
hook:responses:loaded | |
hook:controllers:loaded |
This file contains hidden or 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
/** | |
* Convert text containing newlines to paragraph'd markup. | |
* | |
* @param {String} text Text to add p tags to | |
* | |
* @return {String} Returns paragraphized text | |
*/ | |
function autoParagraph ( text ) { | |
return '<p>' + text.split( /\n+/ ).join( '</p>\n<p>' ) + '</p>'; | |
} |
This file contains hidden or 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
// Create new observable for watching route changes | |
var Router = riot.observable(); | |
// Process routes on both route change and initial load | |
riot.route( processRoute ); | |
riot.route.exec( processRoute ); | |
// Expose the Router object | |
riot.mixin( 'Router', Router ); |
This file contains hidden or 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
/** | |
* Given a string-like-this, return a stringLikeThis. | |
* | |
* @param {String} str String to transform | |
* | |
* @return {String} Returns camelCased string | |
*/ | |
function dashesToCamelCase ( str ) { | |
return str | |
.split( '-' ) |
This file contains hidden or 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
'use strict'; | |
/** | |
* Simple directive for emitting an event when repeat is finished | |
*/ | |
App.directive( 'repeatDoneEvent', function ( $window ) { | |
return function( scope, element, attrs ) { | |
if ( scope.$last ) { | |
// At this point, ng-repeat is done populating - but we're not finished | |
// yet because $compile still has to compile any tags in the repeat |
This file contains hidden or 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
return ('' + str).match( /[A-Z]?[a-z]+/g ) | |
.map( function ( v ) { return v.substr( 0, 1 ).toUpperCase() + v.substr( 1, v.length ); } ) | |
.join( ' ' ); |
This file contains hidden or 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
$combined = array_filter($array1, function ($a) use ($array2) { | |
$found = array_filter($array2, function ($b) use ($a) { | |
return ((int) $a->ID) === ((int) $b->ID); | |
}); | |
return !empty($found); | |
}); |