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>Fit canvas to viewport for mobile devices</title> | |
| <style> | |
| * { | |
| margin: 0; | |
| padding: 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
| /* | |
| * Example how to preload HTML5 video on the iPad (iOS 3.2+) | |
| * @author Miller Medeiros | |
| * Released under WTFPL | |
| */ | |
| var vid = document.createElement('video'); | |
| vid.src = 'lol_catz.mp4'; | |
| document.getElementById('video-holder').appendChild(vid); |
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
| // Check element for class function | |
| function hasClass(element, cls) { | |
| return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1; | |
| } | |
| var gridItem = document.getElementsByClassName('grid-item'); | |
| // Open the lightbox | |
| function lightbox(e) { | |
| e.preventDefault(); |
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
| #add 'node_modules' to .gitignore file | |
| git rm -r --cached node_modules | |
| git commit -m 'Remove the now ignored directory node_modules' | |
| git push origin master |
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 | |
| if (( | |
| strpos($_SERVER["HTTP_USER_AGENT"], "facebookexternalhit/") !== false || | |
| strpos($_SERVER["HTTP_USER_AGENT"], "Facebot") !== false || | |
| strpos($_SERVER["HTTP_USER_AGENT"], "Twitterbot") !== false | |
| ) || ( | |
| // If hash has been set | |
| !isset($_GET['f']) |
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
| // Check if device is iOS | |
| var _iOSDevice = !!navigator.platform.match(/iPhone|iPod|iPad/); |
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
| // Save the canvas on facebook share click | |
| $('.button').on('click', function(e) { | |
| // e.preventDefault(); | |
| // console.log(canvas); | |
| var dataURL = canvas.toDataURL(); | |
| // window.open(canvas.toDataURL('image/png'), '_blank'); | |
| $.ajax({ | |
| type: "POST", | |
| url: "save.php", | |
| data: { |
This file has been truncated, but you can view the full file.
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
| �� �� �I �I s t | |