Skip to content

Instantly share code, notes, and snippets.

View Arifursdev's full-sized avatar
🕷️

Arifursdev

🕷️
View GitHub Profile
@Arifursdev
Arifursdev / git_clone.py
Last active November 25, 2025 09:25
clone git repo without .git folder
import os
import shutil
import subprocess
# Define temp folder name
temp_folder = "unique_temp_folder_12345"
repo_url = "https://github.com/username/abcd.git"
# Clone repo to temp folder
subprocess.run(["git", "clone", repo_url, temp_folder], check=True)
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/flickity.min.css">
<script src="https://unpkg.com/[email protected]/dist/flickity.pkgd.min.js"></script>

<abc-featured-columns>
    <div class="blocks" data-abc-featured-columns="carousel">
      
      
        <div class="col">
            <div class="item">
@Arifursdev
Arifursdev / how-to-add-gap-between-cells-in-a-flickity-carousel.md
Last active August 31, 2025 23:34
how-to-add-gap-between-cells-in-a-flickity-carousel
@Arifursdev
Arifursdev / shopify-custom-pagination.liquid
Last active February 7, 2025 15:57
Shopify Custom Pagination
{% comment %} First page {% endcomment %}
{% comment %} [<] [1] 2 3 [>] {% endcomment %}
{% comment %} Second page {% endcomment %}
{% comment %} [<] 1 [2] 3 [>] {% endcomment %}
{% comment %} Third page {% endcomment %}
{% comment %} [<] 1 2 [3] [>] {% endcomment %}
{%- if paginate.parts.size > 0 -%}
<div class="blog-mb__pagination">
<div class="blog-mb__p-inner">
const repeatWithTimeout = (action, interval) => {
let timerId;
function repeat() {
action();
timerId = setTimeout(repeat, interval);
}
repeat();
@Arifursdev
Arifursdev / pagination-with-alpinejs.md
Last active December 18, 2024 11:55
Pagination with Alpine.js
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Pagination with Alpine.js</title>
    <script
      src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"
@Arifursdev
Arifursdev / load-wordpress-from-theme-folder.php
Created December 11, 2024 21:46
default location of wp-load from theme folder
<?php
require_once( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/wp-load.php' );
@Arifursdev
Arifursdev / upload_files_to_wordpress_php.php
Last active December 11, 2024 19:37
Upload files to WordPress PHP
<?php
$final_submission = [];
if ( isset( $_FILES['files'] ) && is_array( $_FILES['files']) && !empty( $_FILES['files'] ) ) {
$files = $_FILES['files'];
$allowed_file_types = ['image/jpeg', 'image/png', 'video/mp4'];
$max_file_size = 5 * 1024 * 1024; // 5MB
$max_files = 5;
class AdevScrollState {
constructor(element) {
this.scrollableEl = this.selectElement(element);
if (this.scrollableEl === null) return console.error("AdevScrollState: Element not found");
this.isScrollable = false;
this.isScrolled = false;
this.isAtTop = false;
this.isAtBottom = false;
@Arifursdev
Arifursdev / createFormDataFromArray.js
Last active July 11, 2024 12:22
createFormDataFrom Array
function adevCreateFormData(formData, key, data) {
if (data === Object(data) || Array.isArray(data)) {
for (var i in data) {
adevCreateFormData(formData, key + '[' + i + ']', data[i]);
}
} else {
formData.append(key, data);
}
}