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 | |
use Guzzle\Http\Message\Response; | |
use Guzzle\Plugin\Mock\MockPlugin; | |
use Guzzle\Service\Client; | |
use Guzzle\Service\Description\ServiceDescription; | |
use Guzzle\Tests\GuzzleTestCase; | |
class ModelTest extends GuzzleTestCase { |
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
/** | |
* Example Loco JavaScript export. | |
* Usage: var singular = t('File'); | |
* Usage: var multiple = t('File','Files',3); | |
* See: http://localize.biz/free/converter/api#to-js | |
* Locale: pl_PL, Polish | |
*/ | |
var t = function( pairs ){ | |
// named plural forms according to Unicode |
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
/** | |
* Emojify all text nodes in a document | |
* @author Tim Whitlock | |
* @license MIT | |
* | |
* This is available as a compressed bookmarklet at: | |
* - http://apps.timwhitlock.info/emoji/tools/bookmarklet | |
* | |
* See the following links for algorithms and encodings: | |
* - https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/charCodeAt |
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
// File: utils.scss | |
// Define mixins and default IE version in your utils include | |
$ie-version: 10 !default; | |
@mixin ie-max ( $max-version ){ | |
@if $ie-version <= $max-version { | |
@content; | |
} | |
} |
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 onTouchStart( event ){ | |
eachTouchEvent( event, function( i, ev ){ | |
ev.clientX; // <- do something with this | |
} ); | |
return true; | |
} | |
function eachTouchEvent( event, callback ){ |
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
// [...] already calculated xmove and ymove since last movement ... ] | |
if( ymove && Math.abs(ymove) > Math.abs(xmove) ){ | |
// this was intended as a vertical scroll - probably of the page | |
// we will allow this event through so the OS/browser can handle it. | |
return true; | |
} | |
if( xmove ){ | |
// else take control of horizonal scroll position and cancel event | |
element.scrollLeft = Math.max( 0, xstart + xmove ); | |
} |
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
/** | |
* swipe inertia demo for browsers supporting the touchstart family of events | |
* @param HTMLElement | |
* @param Function touchend callback with speed and direction of swipe | |
*/ | |
function initSwiper( el, callback ){ | |
var xstart = 0, // <- initial scroll position on first touch | |
tstarts = [], // <- time each touch started | |
xoffset = [], // <- initial x position of each touch | |
yoffset = []; // <- initial y position of each touch |
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 | |
/** | |
* Boot any comment bot that fills in the author website field. | |
*/ | |
function _tw_intercept_comment( array $data ){ | |
if( empty($data['comment_author_url']) ){ | |
return $data; | |
} | |
get_header(); | |
echo 'See ya'; |
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
/** | |
* Searchable JavaScript dictionary. | |
* | |
* Usage: | |
* var dict = require('path/to/this').create(); | |
* dict.add( 'somedata', 'Text to index' ); | |
* var items = dict.find('text'); | |
*/ | |
exports.create = function(){ | |
return new Dict; |