Skip to content

Instantly share code, notes, and snippets.

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

Hassan Raza hassanrazadev

🏠
Working from home
View GitHub Profile
@hassanrazadev
hassanrazadev / shopify-appbridge-reload.js
Created October 20, 2023 15:47
Reload Shopify embbeded app from ifram using App Bridge
// <script src="https://cdn.jsdelivr.net/npm/@shopify/app-bridge@3.7.9/umd/index.min.js"></script>
const AppBridge = window['app-bridge'];
const createApp = AppBridge.default;
const Redirect = AppBridge.actions.Redirect;
const shopifyApp = createApp({
apiKey: "api_key",
host: new URLSearchParams(document.referrer).get("host"),
forceRedirect: true
@hassanrazadev
hassanrazadev / image-slider.html
Created March 20, 2023 14:41
Simple image slider with HTML, CSS, and JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style>
.slider {
display: flex;
max-width: 640px;
@hassanrazadev
hassanrazadev / supervisord.conf
Created March 10, 2021 17:28
Configuration file for supervisord to run Laravel queue on Linux server.
[supervisord]
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /path/to/laravel/artisan queue:work
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=forge
@hassanrazadev
hassanrazadev / latest_conversation.sql
Last active April 15, 2024 18:27
Get latest conversation with last message per user. (MySQL query)
SELECT
*
FROM
messages,
(
SELECT
MAX(id) as lastid
FROM
messages
WHERE
@hassanrazadev
hassanrazadev / comopserinstall.md
Last active May 1, 2023 17:13 — forked from huzaifa-a/comopserinstall.md
composer install with php memory limit

we can get the composer path from composer help command

 php -d memory_limit=-1 /usr/sbin/composer install  --no-interaction --prefer-dist --optimize-autoloader

============ RUN composer with multiple versions of PHP

To run composer with specific version of PHP use

PATH_TO_PHP\php.exe PATH_TO_COMPOSER\composer.phar install
@hassanrazadev
hassanrazadev / GoogleCloudStorage.php
Last active January 25, 2021 14:07
GoogleCloudStorage helper file for PHP/Larave
<?php
namespace App\Utils;
use Exception;
use Google\Cloud\Storage\StorageClient;
class GoogleCloudStorage{
@hassanrazadev
hassanrazadev / MyPanel.java
Created December 22, 2017 11:25
This is a simple 2D game in java.
import javax.swing.*;
import java.awt.*;
public class MyPanel extends JPanel {
// variables used to draw rectangles at different locations
int mX1 = 20;
int mY1 = 120;
int mX2 = 560;
int mY2 = 120;