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
$.fn.isVisible = function() { | |
// Am I visible? | |
// Height and Width are not explicitly necessary in visibility detection, the bottom, right, top and left are the | |
// essential checks. If an image is 0x0, it is technically not visible, so it should not be marked as such. | |
// That is why either width or height have to be > 0. | |
var rect = this[0].getBoundingClientRect(); | |
return ( | |
(rect.height > 0 || rect.width > 0) && | |
rect.bottom >= 0 && | |
rect.right >= 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
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561 | |
/* | |
* How to delete items from an Array in JavaScript, an exhaustive guide | |
*/ | |
// DON'T use the delete operator, it leaves a hole in the array: | |
var arr = [4, 5, 6]; | |
delete arr[1]; // arr now: [4, undefined, 6] |
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
<IfModule mod_headers.c> | |
# HSTS - force redirect to HTTPS at the browser level. | |
# Submit for Chrome preload list at https://hstspreload.appspot.com/ | |
# Header always set Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload" env=HTTPS | |
# X-Xss-Protection | |
Header always set X-XSS-Protection "1; mode=block" | |
# Stop clickjacking by only allowing us to frame our own site | |
Header always set X-Frame-Options "SAMEORIGIN" |
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 isTouch = function () { | |
return 'ontouchend' in document; | |
} |
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
https://github.com/saxman6989/materializeModal/blob/master/materializeModal.js | |
https://github.com/jenstornell/img-defer.js/blob/master/img-defer.js | |
https://github.com/theuves/subir.js/blob/master/subir.js | |
https://github.com/nishanths/zoom.js/blob/master/js/zoom.js | |
https://github.com/VodkaBears/Remodal/blob/master/src/remodal.js | |
https://github.com/quru/image-defer/blob/master/src/image-defer.js | |
https://github.com/ncou/image-defer-loader/blob/master/img-defer.js | |
https://github.com/benceg/vanilla-modal/blob/master/dist/index.js | |
https://github.com/julienzmiro/zoomzoomzang/blob/master/zzz.js | |
https://github.com/moqmar/tinyfade.js |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>JavaScript HOMEWORK</title> | |
<style> | |
strong{ | |
font-style:italic; | |
font-size:20px; | |
} |
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 user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
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 checkEmail(email) { | |
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; | |
if (!reg.test(email)) return false; | |
return 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Multiple File Upload dengan PHP | Jurnalweb.com</title> | |
</head> | |
<body> | |
<form action="" method="post" enctype="multipart/form-data"> | |
<input type="file" id="file" name="files[]" multiple="multiple" accept="image/*" /> | |
<input type="submit" value="Upload!"> |