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 gallery = { | |
container: null, | |
containerPadding:0, | |
containerWidth:0, | |
itemsArray:[], | |
itemMargin:0, | |
items:[], // Array of all the <img> | |
count:[], | |
maxWidth:0, |
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
/** | |
* | |
* Author: Anton Furuholm | |
* An Easy and lightweight library for writing faster JavaScript | |
* | |
*/ | |
/** | |
* | |
* Functions: |
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
<?php | |
function listFolderFiles($dir){ | |
$foldersAndFiles = scandir($dir); | |
foreach($foldersAndFiles as $item){ | |
if (!in_array($item,array(".",".."))){ // scandir() adds . and .. to the array | |
// Write it out if its an image |
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
root = true | |
[*] | |
indent_style = tab | |
indent_size = 4 | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
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
Show hidden characters
{ | |
"preset": "google", | |
//"preset": "airbnb", | |
"validateIndentation": 4, | |
"requireLineBreakAfterVariableAssignment": true, | |
"requireLineFeedAtFileEnd": true, | |
"requireNewlineBeforeSingleStatementsInIf": true, | |
"requireObjectKeysOnNewLine": true, | |
"requireOperatorBeforeLineBreak": [ | |
"?", |
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 src = document.querySelector("video"); | |
src.addEventListener("click", function() { | |
this.paused === true ? this.play() : this.pause(); | |
}); |
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
// extend.js | |
// Written by Andrew Dupont, optimized by Addy Osmani | |
function extend( destination, source ) { | |
var toString = Object.prototype.toString, | |
objTest = toString.call({}); | |
for ( var property in source ) { | |
if ( source[property] && objTest === toString.call(source[property]) ) { |
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 poll(fn, callback, errback, timeout, interval) { | |
var endTime = Number(new Date()) + (timeout || 2000); | |
interval = interval || 100; | |
(function p() { | |
// If the condition is met, we're done! | |
if(fn()) { | |
callback(); | |
} | |
// If the condition isn't met but the timeout hasn't elapsed, go again |
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 once(fn, context) { | |
var result; | |
return function() { | |
if(fn) { | |
result = fn.apply(context || this, arguments); | |
fn = null; | |
} | |
return result; |
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 getAbsoluteUrl = (function() { | |
var a; | |
return function(url) { | |
if(!a) a = document.createElement('a'); | |
a.href = url; | |
return a.href; | |
}; | |
})(); |
OlderNewer