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 / Theme Links
Last active April 18, 2020 07:31
Shopify theme development series.
@arafatjamil01
arafatjamil01 / Short codes
Created April 18, 2020 09:35
Shopify theme codes
Add favicon:
===========
{% if settings.favicon_enable %}
<link rel="shortcut icon" href="{{ 'favicon.png' | asset_url }}" type="image/png" />
{% endif %}
<!-- Title and description ================================================== -->
<title>
{{ page_title }}{% if current_tags %}{% assign meta_tags = current_tags | join: ', ' %} &ndash; {{ 'general.meta.tags' | t: tags: meta_tags }}{% endif %}{% if current_page != 1 %} &ndash; {{ 'general.meta.page' | t: page: current_page }}{% endif %}{% unless page_title contains shop.name %} &ndash; {{ shop.name }}{% endunless %}
@arafatjamil01
arafatjamil01 / product-section.liquid
Last active May 10, 2020 09:48
Shopify Product, category and images
<section class="products section bg-gray">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="title text-center">
<h2>Trending Products</h2>
</div>
</div>
{% assign home_collections = collections[section.settings.home_product_collection] %}
<div class="row">
/* Normal desktop :1200px. */
@media (min-width: 1200px) and (max-width: 1500px) {
}
/* Normal desktop :992px. */
@media (min-width: 992px) and (max-width: 1200px) {
@arafatjamil01
arafatjamil01 / popular_posts_query.php
Created September 11, 2021 06:40 — forked from mdjwel/popular_posts_query.php
WordPress Custom Query Based Condition
@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='#']");
@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 / 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 / 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 / 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(