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_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.html$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_FILENAME} !-l | |
| RewriteRule . /index.html [L] |
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
| import React, { useState, useEffect } from 'react'; | |
| export const DateTime = () => { | |
| const [dateTime, setDateTime] = useState(new Date()); | |
| useEffect(() => { | |
| const id = setInterval(() => setDateTime(new Date()), 1000); | |
| return () => { | |
| clearInterval(id); | |
| } |
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
| CREATE TABLE IF NOT EXISTS `country` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `iso` char(2) NOT NULL, | |
| `name` varchar(80) NOT NULL, | |
| `nicename` varchar(80) NOT NULL, | |
| `iso3` char(3) DEFAULT NULL, | |
| `numcode` smallint(6) DEFAULT NULL, | |
| `phonecode` int(5) NOT NULL, | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
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
| ######################################################################## | |
| # OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024 | |
| # ---------------------------------------------------------------------- | |
| # @Author: Andreas Hecht | |
| # @Author URI: https://seoagentur-hamburg.com | |
| # License: GNU General Public License v2 or later | |
| # License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
| ######################################################################## | |
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
| generatePagesArray: function(currentPage, collectionLength, rowsPerPage, paginationRange) | |
| { | |
| var pages = []; | |
| var totalPages = Math.ceil(collectionLength / rowsPerPage); | |
| var halfWay = Math.ceil(paginationRange / 2); | |
| var position; | |
| if (currentPage <= halfWay) { | |
| position = 'start'; | |
| } else if (totalPages - halfWay < currentPage) { |
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 saveBlob = (function () { | |
| var a = document.createElement("a"); | |
| document.body.appendChild(a); | |
| a.style = "display: none"; | |
| return function (blob, fileName) { | |
| var url = window.URL.createObjectURL(blob); | |
| a.href = url; | |
| a.download = fileName; | |
| a.click(); | |
| window.URL.revokeObjectURL(url); |
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
| /** | |
| * Recursively copy files from one directory to another | |
| * | |
| * @param String $src - Source of files being moved | |
| * @param String $dest - Destination of files being moved | |
| */ | |
| function rcopy($src, $dest){ | |
| // If source is not a directory stop processing | |
| if(!is_dir($src)) return 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
| //touch/mobile detection | |
| if ( | |
| navigator.userAgent.match(/Phone/i) || | |
| navigator.userAgent.match(/DROID/i) || | |
| navigator.userAgent.match(/Android/i) || | |
| navigator.userAgent.match(/webOS/i) || | |
| navigator.userAgent.match(/iPhone/i) || | |
| navigator.userAgent.match(/iPod/i) || | |
| navigator.userAgent.match(/BlackBerry/) || | |
| navigator.userAgent.match(/Windows Phone/i) || |
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
| { | |
| "estados": [ | |
| { | |
| "sigla": "AC", | |
| "nome": "Acre", | |
| "cidades": [ | |
| "Acrelândia", | |
| "Assis Brasil", | |
| "Brasiléia", | |
| "Bujari", |
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
| // Given a query string "?to=email&why=because&first=John&Last=smith" | |
| // getUrlVar("to") will return "email" | |
| // getUrlVar("last") will return "smith" | |
| // Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/ | |
| function getUrlVar(key){ | |
| var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search); | |
| return result && unescape(result[1]) || ""; | |
| } |
NewerOlder