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
Setup waypoints for each block | |
$('.js-block').each(function(){ | |
addWaypoint( $(this), 'down' ); | |
addWaypoint( $(this), 'up' ); | |
}); | |
function addWaypoint( $elem, direction ){ | |
var thisID = that.formatID( $elem.attr('id') ), | |
nextID = $elem.next('.js-block').attr('id') || null; |
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
(^<[a-z]+.[a-z\"=\s:/.\<]+[>])+(?=[^\<])(?=Yahoo).+?$ |
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
(^<[a-z]+.)[a-z\"=\s:/.\<]+[>]+([^\<]+) | |
<a href="http://www.google.com">Google</a> | |
<a class="myclass" href="http://www.bbc.co.uk">BBC</a> | |
<a id="myid" href="http://www.yahoo.com" class="myclass">Yahoo</a> | |
<div><a href="http://www.google.com">Google</a></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
(^<[^a-z]+|)+(href=\".+?") | |
Returns href attr from... | |
<a href="http://www.google.com">Google</a> | |
<a class="myclass" href="http://www.bbc.co.uk">BBC</a> | |
<a id="myid" href="http://www.yahoo.com" class="myclass">Yahoo</a> | |
<div><a href="http://www.google.com">Google</a></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
^filter:.[a-z]+=\([^)]+\); |
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_color() | |
* Converts a HEX to RGB and vice versa | |
* @param {String or Integer} color Takes a full 6 character HEX "ff5500" / RGB colour value 167 (< 255) | |
* @return {str} returns a HEX or RGB (space delimited), depending on input | |
* | |
*/ | |
function convert_color(color) { | |
var tmp = ""; | |
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
<a[^>]*? (href=\")(.*)(") |
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
@function get-item-by-name( $name, $names-list, $items ){ | |
@return #{ nth( $items, index( $names-list, $name ) ) }; | |
} | |
$font-stack-ids: proxima-light, proxima-regular, proxima-semibold | |
$font-stacks: "'Proxima Nova Light', Tahoma, Arial, Helvetica, sans-serif", | |
"'Proxima Nova Regular', Tahoma, Arial, Helvetica, sans-serif", | |
"'Proxima Nova Semibold', Tahoma, Arial, Helvetica, sans-serif"; | |
@function font-stack( $name ){ |
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
var filter = '.png'; | |
var list = ['userimage105325.png','userimage669.jpg','userimage6929.png','userimage85818.gif']; | |
function filterArray(array, filter){ | |
var i, filteredArray = []; | |
filter = new RegExp(filter, 'g'); | |
for( i = 0, len = array.length; i < len; i++ ){ | |
if( array[i].toString().match(filter) ){ | |
filteredArray.push( array[i] ); | |
} |
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
function log(){ | |
var debug = document.getElementById('debug'), | |
reverse = true, | |
log = Array.prototype.slice.call( arguments, 0 ).join('{join}').replace(/{join}/g, '<br>'); | |
debug.innerHTML = (reverse)? log + '<br>' + debug.innerHTML : debug.innerHTML + '<br>' + log; | |
} | |
log(myObject.name, myObject.thing, 'With a label: ' + myObject.label); |