Skip to content

Instantly share code, notes, and snippets.

Kylie Rose thisiskylierose

  • Australia
Block or report user

Report or block thisiskylierose

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thisiskylierose
thisiskylierose / requestAnimationFrame.js
Created Feb 23, 2018 — forked from jacob-beltran/requestAnimationFrame.js
React Performance: requestAnimationFrame Example
View requestAnimationFrame.js
// How to ensure that our animation loop ends on component unount
componentDidMount() {
this.startLoop();
}
componentWillUnmount() {
this.stopLoop();
}
View CMD WINDOW
cd ..
start cmd.exe @cmd /k "grunt serve"
start cmd.exe @cmd /k
View modernizr-ios6-test.js
// i know, i know, browser sniffing :(
// adaptation of http://stackoverflow.com/questions/8348139/detect-ios-version-less-than-5-with-javascript
Modernizr.addTest('ios6', function() {
var ios6 = false,
v, ver = false;
if (/iP(hone|od|ad)/.test(navigator.platform)) {
v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/),
ver = parseInt(v[1], 10),
View gist:16756b9021bad5e484df
(function($, functionName) {
'use strict';
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function(cb, threshold, execAsap) {
var timeout;
return function debounced() {
var obj = this,
View gist:5f2d4a3184d002626c8d
// Register multi-tasks
grunt.registerMultiTask( 'conditional', 'Conditional tasks', function() {
switch ( this.target ) {
case 'case1':
grunt.task.run( this.data.tasks );
break;
case 'case2':
grunt.task.run( this.data.tasks );
break;
case 'case3':
@thisiskylierose
thisiskylierose / gist:331c154f89e7ae0ca56e
Last active Aug 29, 2015
Wordpress functions to run image replace for timthumb
View gist:331c154f89e7ae0ca56e
/*-----------------------------------------------------------------------------------*/
/* Replace image src values
/*-----------------------------------------------------------------------------------*/
if (!function_exists('ic_replace_image_src')) {
function ic_replace_image_src($img = null) {
$live = 'mysite.com.au ';
if ($_SERVER['HTTP_HOST'] == $live) {
return;
} else {
@thisiskylierose
thisiskylierose / 0_reuse_code.js
Created Feb 4, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:bb0d2f63133c021dcfb4
// set thing
TweenMax.set('#SC1T4W', {clip: 'rect(0px, 0px, 40px, 0px)', alpha: 0});
//animate thing
TweenMax.to('#SC1T4W', 0.3, {clip: 'rect(0px, 774px, 40px, 0px)', delay: 0.1}); // expands to the right
TweenMax.to('#SC1T4W', 0.3, {clip: 'rect(0px 774px 40px 774px)', delay: 0.4}); // contracts to left
// reset thing
TweenMax.set('#SC1T4W', {clip: 'rect(0px, 0px, 40px, 0px)', alpha: 0});
You can’t perform that action at this time.