Building a countdown timer based off https://www.sitepoint.com/build-javascript-countdown-timer-no-dependencies/ and https://codepen.io/SitePoint/pen/MwNPVq
A Pen by janzeteachesit on CodePen.
| <?php | |
| class FileHelper | |
| { | |
| public static function openAndLock($filename) | |
| { | |
| $fh = fopen($filename, 'r+'); | |
| if (!$fh || !flock($fh, LOCK_EX)) { | |
| return false; | |
| } |
| // Example starter JavaScript for disabling form submissions if there are invalid fields | |
| (function () { | |
| 'use strict'; | |
| window.addEventListener('load', function () { | |
| // Fetch all the forms we want to apply custom Bootstrap validation styles to | |
| var forms = document.getElementsByClassName('needs-validation'); | |
| // Loop over them and prevent submission | |
| var validation = Array.prototype.filter.call(forms, function (form) { | |
| form.addEventListener('submit', function (event) { | |
| event.preventDefault(); |
| RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
| RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache | |
| npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache | |
| Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache |
Building a countdown timer based off https://www.sitepoint.com/build-javascript-countdown-timer-no-dependencies/ and https://codepen.io/SitePoint/pen/MwNPVq
A Pen by janzeteachesit on CodePen.
| <div class="the-return"> | |
| [HTML is replaced when successful.] | |
| </div> |
Have you ever wanted to get a specific data from another website but there's no API available for it? That's where Web Scraping comes in, if the data is not made available by the website we can just scrape it from the website itself.
But before we dive in let us first define what web scraping is. According to Wikipedia:
{% blockquote %} Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox. {% endblockquote %}
| <?php | |
| $timezones = array( | |
| 'America/Adak' => '(GMT-10:00) America/Adak (Hawaii-Aleutian Standard Time)', | |
| 'America/Atka' => '(GMT-10:00) America/Atka (Hawaii-Aleutian Standard Time)', | |
| 'America/Anchorage' => '(GMT-9:00) America/Anchorage (Alaska Standard Time)', | |
| 'America/Juneau' => '(GMT-9:00) America/Juneau (Alaska Standard Time)', | |
| 'America/Nome' => '(GMT-9:00) America/Nome (Alaska Standard Time)', | |
| 'America/Yakutat' => '(GMT-9:00) America/Yakutat (Alaska Standard Time)', | |
| 'America/Dawson' => '(GMT-8:00) America/Dawson (Pacific Standard Time)', |
| "use strict"; | |
| // Load plugins | |
| const autoprefixer = require("autoprefixer"); | |
| const browsersync = require("browser-sync").create(); | |
| const cp = require("child_process"); | |
| const cssnano = require("cssnano"); | |
| const del = require("del"); | |
| const eslint = require("gulp-eslint"); | |
| const gulp = require("gulp"); |
A list of useful commands for the ffmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| <?php | |
| # Nginx don't have PATH_INFO | |
| if (!isset($_SERVER['PATH_INFO'])) { | |
| $_SERVER['PATH_INFO'] = substr($_SERVER["ORIG_SCRIPT_FILENAME"], strlen($_SERVER["SCRIPT_FILENAME"])); | |
| } | |
| $request = substr($_SERVER['PATH_INFO'], 1); | |
| $file = $request; | |
| $fp = @fopen($file, 'rb'); |