Use the following configuration in Apache's httpd.conf file or within a virtual host configuration. Note that you should set DocumentRoot
and ServerName
fit to your environment:
This file contains 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
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// or | |
const sleep = util.promisify(setTimeout); |
This file contains 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
// Mock Request Data (Pull Request Comment) | |
module.exports = { | |
url: { | |
hash: null, | |
search: null, | |
query: {}, | |
pathname: '/hooks/2f7YhFx2f7YhFx2f7YhFx/hUPO&&)6@HqG_wY^B(2$MK_ivkEU1ix7MK_ivkEU1ix7', | |
path: '/hooks/2f7YhFx2f7YhFx2f7YhFx/hUPO&&)6@HqG_wY^B(2$MK_ivkEU1ix7MK_ivkEU1ix7' | |
}, | |
url_raw: '/hooks/2f7YhFx2f7YhFx2f7YhFx/hUPO&&)6@HqG_wY^B(2$MK_ivkEU1ix7MK_ivkEU1ix7', |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
This file contains 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 program is free software; you can redistribute it and/or | |
// modify it under the terms of the GNU General Public License | |
// as published by the Free Software Foundation; either version 2 | |
// of the License, or (at your option) any later version. | |
// | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. |
This file contains 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
IMPORTANT | |
Please duplicate this radar for a Safari fix! | |
This will clean up a 50-line workaround. | |
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072) | |
////////////////////////////////////////////////////////////////////////////// | |
(Now available as a standalone repo.) |
This file contains 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
DROP TABLE IF EXISTS `groups`; | |
-- | |
-- Table structure for table 'groups' | |
-- | |
CREATE TABLE `groups` ( | |
`id` integer NOT NULL, | |
`name` varchar(20) NOT NULL, | |
`description` varchar(100) NOT NULL, |
This file contains 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
/** | |
* Language list Code for non-Widget users | |
* | |
* @global array $q_config | |
* @param string $sep | |
*/ | |
function qtrans_generate_language_list($sep = " | ") { | |
global $q_config; | |
$languages = qtrans_getSortedLanguages(); | |
$num_langs = count($languages); |
This file contains 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 sendError(message, url, lineNum) { | |
var i; | |
// First check the URL and line number of the error | |
url = url || window.location.href; | |
lineNum = lineNum || 'None'; | |
// If the error is from these 3rd party script URLs, we ignore | |
// We could also just ignore errors from all scripts that aren't our own | |
var scriptURLs = [ |
NewerOlder