Skip to content

Instantly share code, notes, and snippets.

View arafatjamil01's full-sized avatar
🏠
Working from home

Arafat Jamil arafatjamil01

🏠
Working from home
View GitHub Profile
@arafatjamil01
arafatjamil01 / oh-my-posh-tokyo-night-customized
Last active June 4, 2024 20:17
Oh my posh tokyo night customized for windows power shell. This one shows if git changes are not committed or pushed
{
"$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",
@arafatjamil01
arafatjamil01 / customization.xml
Last active August 16, 2022 04:48
PHPCS customization personally
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">
@arafatjamil01
arafatjamil01 / wordpress_useful_codes.php
Last active March 3, 2022 13:20
Useful codes in wordpress
// 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' ) )
/**
*
* Import Class
* A helper class for support CS to OCDI
*
*/
if ( !class_exists( 'OCDI_Plugin' ) )
return;
@arafatjamil01
arafatjamil01 / wifi.sh
Last active December 15, 2021 21:09
Wifi penetration testing notes
# -------- 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
@arafatjamil01
arafatjamil01 / WordPress_query_cheatsheet.php
Last active January 9, 2023 18:11
WordPress query cheatsheet, wp_query, meta_query, comparison, relations and what not.
<?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(
@arafatjamil01
arafatjamil01 / down_pdf.js
Created November 17, 2021 10:51
Download google drive protected pdfs
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)) {
@arafatjamil01
arafatjamil01 / github_desktop_ubuntu.sh
Created November 13, 2021 05:43 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
## 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
@arafatjamil01
arafatjamil01 / WordPress Ajax
Created November 10, 2021 09:26
WordPress AJAX actions
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.
@arafatjamil01
arafatjamil01 / Themeforest check js
Last active February 5, 2022 12:55
Find all the links on a webpage or empty links
// 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='#']");