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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"console_title_template": " {{ .Folder }} :: {{if .Root}}Admin{{end}}", | |
"palette": { | |
"main-bg": "#24283b", | |
"terminal-red": "#f7768e", | |
"pistachio-green": "#9ece6a", | |
"terminal-green": "#73daca", | |
"terminal-yellow": "#e0af68", | |
"terminal-blue": "#7aa2f7", |
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
Convert long array syntax into short array ones, | |
replace the line - Generic.Arrays.DisallowShortArraySyntax to Generic.Arrays.DisallowLongArraySyntax | |
------------ | |
<rule ref="Generic.Arrays.DisallowLongArraySyntax"> | |
<type>warning</type> | |
</rule> | |
Fix \r\n issue for spacing | |
----------- | |
<rule ref="Generic.Files.LineEndings"> |
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
// Post author id retrieving from a post | |
$post_author_id = get_post_field( 'post_author', get_the_ID() ); | |
// Get date from theme setttings | |
the_time( get_option( 'date_format' ) ) |
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
/** | |
* | |
* Import Class | |
* A helper class for support CS to OCDI | |
* | |
*/ | |
if ( !class_exists( 'OCDI_Plugin' ) ) | |
return; |
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
# -------- Preconnection Attacks | |
#============================================ | |
ifconfig wlan0 down | |
#change the mac address of wireless adapter | |
ifconfig wlan0 hw ether 00:11:22:33:44:55 | |
#---------helping process------ | |
airmon-ng check kill | |
#------------- | |
#turn on monitor mode, process 1, the device must be down | |
iwconfig wlan0 mode monitor |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* | |
* CODEX: https://developer.wordpress.org/reference/classes/wp_query/ | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ | |
$args = array( |
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 jspdf = document.createElement("script"); | |
jspdf.onload = function () { | |
let pdf = new jsPDF(); | |
let elements = document.getElementsByTagName("img"); | |
for (let i in elements) { | |
let img = elements[i]; | |
console.log("add img ", img); | |
if (!/^blob:/.test(img.src)) { |
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
## Follow this link for further updates to Github Desktop for Ubuntu https://github.com/shiftkey/desktop/releases/latest | |
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows | |
sudo wget https://github.com/shiftkey/desktop/releases/download/release-2.9.3-linux3/GitHubDesktop-linux-2.9.3-linux3.deb | |
### Uncomment below line if you have not installed gdebi-core before | |
# sudo apt-get install gdebi-core | |
sudo gdebi GitHubDesktop-linux-2.9.3-linux3.deb | |
# UPDATE (2021-03-05): Thanks to PaoloRanzi81's comment, the updated code is as follows https://gist.github.com/PaoloRanzi81 |
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
Tasks to do: | |
---------------- | |
> use actions wp_ajax_(action_name_here) & wp_ajax_nopriv_(action_name_here) to initiate functions | |
> you can use the same or different functions for the same purpose | |
> then define the ajax js file, use jQuery if needed, wordpress has jquery inside already | |
> use wp_localize_script('js_file_handle','name_of_object',[ 'key' => 'value ] | |
> the key value pair can be given primarily the wordpress ajax url admin_url('admin-ajax.php') | |
> define the ajax action name in the jquery, exactly like the action name in wp_ajax_(action_name_here) hook. | |
> write the function as needed. e.g - beforeSend, success keys in jQuery or state change in vanilla JS | |
> according to the defined actions, wordPress should just work fine. |
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
// get all the links of the webpage | |
let links = document.querySelectorAll('a'); | |
for (let i = 0; i < links.length; i++) { | |
console.log(links[i]); | |
} | |
// get all the empty links of the webpage | |
let links = document.querySelectorAll("a[href='#']"); |
NewerOlder