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 | |
use App\User; | |
use Spatie\Permission\Models\Role; | |
use Spatie\Permission\Models\Permission; | |
$editorRole = Role::create(['name' => 'Editor']); | |
$userRole = Role::create(['name' => 'User']); | |
$adminRole = Role::create(['name' => 'Admin']); | |
// Permissions |
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
[ | |
{ | |
"name": "Apps", | |
"children": [ | |
{ | |
"name": "Art & Design", | |
"description": "Sketchbooks, painter tools, art & design tools, coloring books" | |
}, | |
{ | |
"name": "Auto & Vehicles", |
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 | |
printf "Original String: " | |
read -r ufr_oristring | |
if [[ -z "$ufr_oristring" ]] | |
then | |
echo -e "\e[31mPlease provide the original string that needs to be replaced\e[39m" | |
exit | |
fi | |
printf "New String (This will replace the Original String): " |
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
{ | |
"1": { | |
"name": "Arts", | |
"sub": [ | |
"Design", | |
"Fashion & Beauty", | |
"Food", | |
"Literature", | |
"Performing Arts", | |
"Visual Arts" |
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 | |
################################################################ | |
# A simple script to install Token Dispenser on an Ubuntu server | |
# Author: Rehmat Alam | |
# Website: https://supportivehands.net | |
################################################################ | |
read -p "Gmail ID: " gmailAddress | |
read -p "Account Password: " accountPassword | |
read -p "Server's Public IP: " serverIP |
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
#!/usr/bin/php | |
<?php | |
######################################################### | |
# Name: WebDav Recursive Upload # | |
# Description: Uploads files and directories # | |
# to a remote WebDav machine recursively # | |
# Author: Rehmat Alam # | |
# Website: https://rehmat.works # | |
######################################################### |
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
require_once ('/path/SimpleShortcodes.php'); | |
$simpleshortcodes = new SimpleShortcodes(); | |
$shortcodes = array('[name]' => '{$name}'); | |
$simpleshortcodes->add($shortcodes); | |
// An array that contains user information. You can use multidimensional arrays to include more details about the user | |
$users = array('User 1', 'User 2', 'User 3', 'User 4', 'User 5'); | |
$message = 'Hello [name], we are here with the introduction to our newest product. Blah blah blah...'; |
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
echo $simpleshortcodes->read($message); // Will print Hello Rehmat, do you live in Pakistan? |
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
echo $message; // Prints out Hello [first_name], do you live in [user_country]? |
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
$message = 'Hello [first_name], do you live in [user_country]?'; |