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
/* https://stackoverflow.com/questions/20626685/better-way-to-set-distance-between-flexbox-items */ | |
.grid{ | |
display: flex; | |
flex-flow: row wrap; | |
justify-content: space-between; | |
margin-top: 3rem; | |
--num: 1; | |
/* No Grid support = flex */ |
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
Flex : | |
row | |
> __col | |
list | |
> __item | |
.card__primary // Text content | |
.card__secondary // Image |
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
//Kill all Tweens currently running | |
TweenMax.killTweensOf( $('.my_object') ); | |
// Sets Global ease | |
TweenLite.defaultEase = Circ.easeOut; | |
// Sets Global transform perspective | |
CSSPlugin.defaultTransformPerspective = 500; | |
// onComplete get self element |
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
// auth parameters | |
$api_key = urlencode(''); // Consumer Key (API Key) | |
$api_secret = urlencode(''); // Consumer Secret (API Secret) | |
$auth_url = 'https://api.twitter.com/oauth2/token'; | |
// what we want? | |
$data_username = ''; // username | |
$data_count = 1; // number of tweets | |
$data_url = 'https://api.twitter.com/1.1/statuses/user_timeline.json'; // Change if you need to search for something else |
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
tail -f /Applications/MAMP/logs/php_error.log |
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
//Clears the input on focus, restore its initial content on blur if nothing entered by user | |
var input = $('input[type=text]'); | |
input.focus(function() { | |
var el = $(this); | |
if(el.val() === el.attr('data-placeholder')){ | |
$(this).val(''); | |
} |
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
/* | |
* Specifies folders and wich matchmedia we use | |
* here I want a desktop 'normal' image, a desktop/ipad 3 retina image, | |
a mobile or a mobile retina image | |
fallback to noscript loads the desktop one. | |
*/ | |
function getResponsiveImg($imageName, $altAttribute) | |
{ |
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
/*FOR LOOPS | |
-------------------------------------------*/ | |
//SLOW -> (no caching of the length) | |
for (var i = 0; i < myArray.length; i++) {} | |
//GOOD -> (caching the length) : http://jsperf.com/forloops3 | |
for (var i = 0, l = myArray.length; i < l; i++) {} | |
//BEST -> backwards for loop + caching the length : http://jsperf.com/forward-and-backward-for-loops/2 |