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
https://tips.tutorialhorizon.com/2015/10/19/list-running-processes-in-terminal-filter-and-kill-them-if-required/ | |
To find all instances of node running: | |
ps -a | grep node | |
-a means all, 'node' means all node instances. | |
The PID is the first number. The below kills it: |
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
let re; | |
re = /hello/; | |
re = /hello/i; // i = case insensitive | |
// re = /hello/g; // Global search | |
// console.log(re); | |
// console.log(re.source); | |
// exec() - Return result in an array or null | |
// const result = re.exec(`hello world`); |
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
let re; | |
// Literal Characters | |
re = /hello/; | |
re = /hello/i; | |
// Metacharacter Symbols | |
re = /^h/i; // Must start with | |
re = /world$/i; // Must end with | |
re = /^hello$/i; // Must begin and end with |
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 findAncester(el, cls) { | |
while (((el = el.parentElement) && !el.classList.contains(cls)) || el.tagName === "BODY"); | |
return el; | |
} |
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
<?php | |
$link = mysqli_connect("HOSTNAME", "DATABSEUSERNAME", "PASSWORD", "DATABASE"); | |
if(mysqli_connect_error()){ | |
die("There was an error connecting to the database."); | |
} | |
$query = "SELECT * FROM users"; |
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
<?php | |
$link = mysqli_connect("HOST", "USERNAME", "PASSWORD", "DATABASE"); | |
if(mysqli_connect_error()){ | |
die("There was an error connecting to the database."); | |
} | |
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
<?php | |
$link = mysqli_connect("HOST", "USERNAME", "PASSWORD", "DATABASENAME"); | |
if(mysqli_connect_error()){ | |
die("There was an error connecting to the database."); | |
} | |
if($_POST){ |
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
if (document.readyState !== 'loading') { | |
readyFunction(); | |
} else { | |
document.addEventListener('DOMContentLoaded', function () { | |
readyFunction(); | |
}); | |
} | |
function readyFunction(){ | |
// |
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
// https://github.com/GeekyAnts/vue-native-core/issues/117 | |
//In app.json put: | |
"sourceExts": [ | |
"js", | |
"json", | |
"ts", | |
"tsx", | |
"jsx", | |
"vue" |
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
/** | |
* Add REST API for BBPress | |
* / | |
* Thanks to Barry at https://bbpress.org/forums/topic/is-there-an-api-for-bbpress/ | |
*/ | |
function bbpress_enable_rest_api() { | |
$types = array( | |
bbp_get_reply_post_type(), | |
bbp_get_forum_post_type(), | |
bbp_get_topic_post_type(), |
OlderNewer