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 exGAP(){ | |
'use strict'; | |
$('.is__gap').each(function(){ | |
var t = $(this), | |
off = t.offset().top, | |
step = t.data('step'), | |
reverse = t.hasClass('__reverse') ? -1 : 1; | |
if( screen() >= off - screen('height')) { | |
t.css('background-position','50% '+ reverse * parseInt( ( screen() - off ) / (step || 4) , 10) + 'px'); | |
} |
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 load_defer_img(source) { | |
'use strict'; | |
return $.Deferred(function(task) { | |
var image = new Image(); | |
image.onload = function() { | |
task.resolve(image); | |
}; | |
image.onerror = function() { | |
task.reject(); | |
}; |
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 | |
/* | |
You need to authorize your app with scope=public_content | |
Example: | |
https://api.instagram.com/oauth/authorize/?client_id=YOUR_CLIENT_ID&redirect_uri=REDIRECT_URL&response_type=token&scope=public_content | |
*/ | |
$get_my_insta = instagram_feed('USERNAME', 'APP_IP', 'ACCESS_TOKEN', 10); | |
if ( $get_my_insta ) { |
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
cd /System/Library/CoreServices/Finder.app/Contents/Resources/English.lproj/ (or whatever language you're running) | |
sudo plutil -convert xml1 InfoPlist.strings | |
sudo nano InfoPlist.strings (edit folder here) | |
sudo plutil -convert binary1 InfoPlist.strings |
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
.input-number-box { | |
@include transform(translate3d(0,0,0)); | |
@include border-radius(5px); | |
position: relative; | |
background: #000; | |
overflow: hidden; | |
text-align: left; | |
width: 100px; | |
* {@include transform(translate3d(0,0,0));} |
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 resizeIframe(iframe) { | |
iframe.height = iframe.contentWindow.document.body.scrollHeight + "px"; | |
} | |
function iFrameLoaded( id, src ) { | |
var deferred = $.Deferred(), | |
iframe = $( "<iframe class='hiddenFrame' onload='resizeIframe(this)' width='100%' scrollin='no'></iframe>" ).attr({ | |
"id": id, | |
"src": src | |
}); |
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
//based on https://gist.github.com/pburtchaell/e702f441ba9b3f76f587 | |
//with added support for iphone 3 and 4 and orinetation support for iphone 5. | |
//this is for all devices which can run iOS7 in all orientations. | |
//not a mixin to avoid to much duplicate code when using on multiple selectors. | |
.selector { | |
$height: 70; //set your height in vh | |
$heightPercent: $height/100; | |
height: #{$height}vh; | |
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
var supportsTouch = window.hasOwnProperty('ontouchstart') || window.navigator.msPointerEnabled ? true : false, | |
$.fn.mobileFix = function (options) { | |
var $parent = $(this), | |
$fixedElements = $(options.fixedElements); | |
$(document) | |
.on('focus', options.inputElements, function(e) { | |
$parent.addClass(options.addClass); | |
}) |
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
// Load the YouTube API asynchronously | |
var tag = document.createElement('script'), | |
firstScriptTag = document.getElementsByTagName('script')[0], | |
player; | |
tag.src = "https://www.youtube.com/iframe_api"; | |
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
// Create the player object when API is ready | |
window.onYouTubeIframeAPIReady = function () { |