CFLAGS="-Wno-error=implicit-function-declaration" RUBY_CONFIGURE_OPTS='--with-readline-dir=/usr/local/opt/readline/' arch -x86_64 rbenv install 2.4.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script.sh | |
#! /bin/bash | |
source ${HOME}/.bashrc | |
cd /absolute/path/to/my/project | |
export NODE_ENV=development | |
npm start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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[@]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: wordpress-wordpress | |
spec: | |
storageClassName: "" | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: data-wordpress-mariadb-0 | |
spec: | |
storageClassName: "" | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: |
NewerOlder