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
# Define variables | |
EC2_INSTANCE_IP = <EC2_instance_IP> | |
RDS_INSTANCE_IP = <RDS_instance_IP> | |
USERNAME = <username> | |
PASSWORD = <password> | |
DATABASE_NAME = <database_name> | |
DUMP_FILE = dump.sql | |
# Define the export and import commands | |
export: |
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
# ################################################################################ | |
# # Install AWS CLI | |
RUN apk add --no-cache python3 py3-pip | |
RUN pip3 install --break-system-packages --upgrade pip | |
RUN pip3 install --break-system-packages awscli | |
ARG AWS_REGION | |
ARG AWS_ACCESS_KEY_ID | |
ARG AWS_SECRET_ACCESS_KEY | |
ARG AWS_BUCKET |
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 off | |
setlocal enabledelayedexpansion | |
rem Define arrays for paths and targets | |
set "Dirs[0]=PATH_TO_IMAGE_DIRECTORY" | |
set "Dirs[1]=PATH_TO_LOGOS_DIRECTORY" | |
set "Dirs[2]=PATH_TO_SVG_DIRECTORY" | |
set "Dirs[3]=PATH_TO_IMG_DIRECTORY" | |
set "Targets[0]=TAEGET_IMAGE_DIRECTORY" |
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
// Github: ahmedrowaihi | |
// HOW TO USE: | |
// OPEN THE browser console | |
// Press [CTRL + SHIFT + I] | |
// THEN COPY PASTE THE CODE BELLOW TO THE CONSOLE AND HIT [ENTER] | |
const elements = Array.from(document.all).filter(element => element.id.endsWith('rbAnswer')); | |
elements.forEach(element => { | |
const radioButtons = element.querySelectorAll('input[type="radio"]'); | |
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
export function indecator() { | |
const spinner = ['-', '\\', '|', '/'] | |
let i = 0 | |
let interval | |
return { | |
stop(string) { | |
if (interval) clearInterval(interval) | |
if (string) process.stdout.write(`${string}\n`) |
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
const fs = require("fs"); | |
const binlogFile = "allbinglog.sql"; // bin log file name | |
const db = ""; // db name | |
const table = ""; // table | |
const outputFile = "output.sql"; | |
const pattern = new RegExp( |
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
function mysqlInsertToEloquent(model, raw, excludeKey = [], excludeValue = []) { | |
const tableName = raw.match(/(?<=INSERT INTO `)(.*?)(?=`)/)[0]; | |
const columns = raw.match(/(?<=\()(.+?)(?=\))/)[0].split(",").map(c => c.trim().replace(/`/g, '')); | |
const values = raw.match(/(?<=VALUES \()(.*?)(?=\);?$)/)[0].split("),("); | |
let record = ''; | |
values.forEach(val => { | |
const modelData = {}; | |
const vals = val.split(","); |
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
// Modify "didFinishLaunchingWithOptions" method in IOS AppDelegate.mm | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// Ahmed Rowihi: Native Side I18n hack :D | |
// set React Native I18nManager before the JS Bundle Kicks Off! | |
NSString *value = [[NSUserDefaults standardUserDefaults] stringForKey:@"@user_language"]; | |
BOOL isRTL = [value isEqualToString:@"ar"] || [[[NSLocale preferredLanguages] objectAtIndex:0] hasPrefix:@"ar_"]; | |
if (isRTL) { | |
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"ar"]; |
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
/** A regex of saudi number pattern | |
* numbers will be accepted must match following formats: | |
* 9665xxxxxxxx, 009665xxxxxxxx, 05xxxxxxxx, +9665xxxxxxxx | |
* ^(\+966|966|00966|0)5 means that the number can start with +9665 or 9665 or 009665 or 05 | |
* \d{8}$, means there should be 8 digits, and $ means the end of the string. | |
* All together: ^(\+966|966|00966|0)5\d{8}$ | |
*/ | |
const SaudiNumRegExp = /^(\+966|966|00966|0)5\d{8}$/; | |
export default SaudiNumRegExp; |