Skip to content

Instantly share code, notes, and snippets.

@zaheeraws
zaheeraws / GGL.md
Last active September 18, 2023 07:29

General Guidelines

 CFLAGS="-Wno-error=implicit-function-declaration" RUBY_CONFIGURE_OPTS='--with-readline-dir=/usr/local/opt/readline/' arch -x86_64 rbenv install 2.4.

Update all customers default payment method

script.sh
#! /bin/bash
source ${HOME}/.bashrc
cd /absolute/path/to/my/project
export NODE_ENV=development
npm start
import jwt from 'jsonwebtoken'
import dotenv from 'dotenv'
dotenv.config()
const varifyToken = async (req, res, next) => {
const token = req.cookies.access_token || req.headers.authorization?.split(' ')[1];
if (!token) return res.status(401).json({ status: 401, message: "Auth token is required" });
jwt.verify(token, process.env.JWT_SECRET, (err, user) => {
if (err) return res.status(401).json({ status: 401, message: "Token is not valid" });
req.user = user;
next()
# @author Usman Javaid <[email protected]>
# @author Zaheer <[email protected]>
#
# Github Action to push the current repo to another repo.
# Note: PR title should be descriptive as it will be used for commit message
# Create a file .github/workflows/sync-repo.yml
# Steps to setup
# 1. Choose the branch/branches against which to trigger this action.
# 2. Create the following Action variables:
# i. TARGET_BRANCH | Branch to push to the other repository.
#!/bin/bash
declare -a DIRS=("tmp" "video_clips" "video_thumbnails", "pdfs", "extracts", "coverage")
DAYS_TO_KEEP=3
BASE_PATH="/home/aviary/current"
BASE_PATH="/Users/mac/Documents/projects/aviary"
DIRS_LIST=${#DIRS[@]}
/**
* Will wait for an iframe to be ready
* for DOM manipulation. Just listening for
* the load event will only work if the iframe
* is not already loaded. If so, it is necessary
* to observe the readyState. The issue here is
* that Chrome will initialize iframes with
* "about:blank" and set its readyState to complete.
* So it is furthermore necessary to check if it's
* the readyState of the target document property.
SITE_NAME=
sudo mkdir -p /var/www/{$SITE_NAME}
sudo chown -R pi:www-data /var/www/{$SITE_NAME}
sudo chmod -R 755 /var/www/{$SITE_NAME}
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/{$SITE_NAME}.conf
<?php
//sudo apt install php
//sudo apt-get install php-imagick
function backgroundMasking($path)
{
$imagick = new \Imagick(realpath($path));
$backgroundColor = "rgb(255, 255, 255)";
$fuzzFactor = 0.6;
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: wordpress-wordpress
spec:
storageClassName: ""
accessModes:
- ReadWriteOnce
resources:
requests:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: data-wordpress-mariadb-0
spec:
storageClassName: ""
accessModes:
- ReadWriteOnce
resources:
requests: