Skip to content

Instantly share code, notes, and snippets.

View bouchaala-sabri's full-sized avatar

Sabri Bouchaala bouchaala-sabri

  • Yasmina Web Agency
  • Ariana, Tunisia
View GitHub Profile
const AWS = require('aws-sdk');
const dynamodb = new AWS.DynamoDB.DocumentClient();
const tableName = 'Hotels';
async function storeHotel(hotelId, newAttributes) {
const params = {
TableName: tableName,
Key: { id: hotelId }
};
@bouchaala-sabri
bouchaala-sabri / stable-diffusion-negative-prompt.txt
Last active November 17, 2022 17:42
Stable Diffusion Negative Prompt
nipple, ugly, duplicate, morbid, mutilated, tranny, trans, trannsexual, hermaphrodite, [out of frame], extra fingers, mutated hands, poorly drawn face, mutation, deformed, blurry, bad anatomy, proportions, limbs, cloned disfigured. more than 2 nipples, out frame, gross malformed missing arms, legs, fused too many long neck, multiple persons, two, lowres, text, error, cropped, worst quality, artist name, low jpeg artifacts, dehydrated, disfigured, poor quality resolution, incoherent, drawn, lines, messy drawing, poorly-drawn, poorly-drawn disjointed, asymmetrical cross-eyed, digit, fewer digits, normal signature, watermark, username, name
@bouchaala-sabri
bouchaala-sabri / gist:24d0486be5a7266556409feb247afffb
Created March 25, 2022 10:53
Order Followed status Enumeration
ToBeProcessed - A traiter.
Validated - Validée.
ToSupplyInCentral - A approvisionner en central.
ToSupplyInStore - Demandée en central.
ToBeDeliveredByStore - A livrer par la boutique.
InPreparation - En cours de préparation.
Prepared - Préparée.
ShipByCentral - Expédiée.
ShipByLogistic - Expédiée par logisticien.
ShipByStore - Expédiée par boutique.
@bouchaala-sabri
bouchaala-sabri / fix-dovecot-mysql-cyberpanel.sh
Created December 10, 2020 08:25
Fix dovecot-mysql on cyberpanel | Authentication Failed | auth: Fatal: sql: Unknown database driver 'mysql'
apt remove dovecot-core dovecot-mysql dovecot-pop3d dovecot-imapd
sed -e '/deb/ s/^#*/#/' -i /etc/apt/sources.list.d/dovecot.list
apt clean all
apt install dovecot-core dovecot-mysql dovecot-pop3d dovecot-imapd
apt-get install -y libmysqlclient-dev
<?php
echo preg_replace('/[[:^print:]]/', '', "Lorem ipsum dolor sit amet, consectetur adipiscing elit. 🇬🇧🍁🍃🍂🌰🍁🌿🌾🌼🌻");
?>
@bouchaala-sabri
bouchaala-sabri / sql
Last active July 12, 2020 11:08
remove wp_term_relationships and wp_postmeta from old posts
DELETE
b,
c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE DATEDIFF(NOW(), post_date) > 90 AND a.post_type='story'
@bouchaala-sabri
bouchaala-sabri / gist:18538bd796d6713a5aa2989a98152fc9
Created June 30, 2020 10:25
Fix local by flywheel TLS loop issue on windows
docker-machine stop local-by-flywheel;
rm -rf ~/.docker/machine/certs;
docker-machine create local-cert-gen;
docker-machine start local-by-flywheel;
docker-machine regenerate-certs -f local-by-flywheel;
docker-machine rm -f local-cert-gen;
@bouchaala-sabri
bouchaala-sabri / reverseString.php
Last active September 5, 2018 14:34
Function to reverse a String without using PHP built-in functions
<?php
/* Function to reverse a String without using PHP built-in functions
Author: Sabri Bouchaala
*/
function my_str_rev ($str)
{
$head = 0;
$tail = count($str);
@bouchaala-sabri
bouchaala-sabri / wp.sh
Created November 18, 2013 17:03 — forked from chrisl8888/wp.sh
#!/bin/bash
echo “Database Name: ”
read -e dbname
echo “Database User: ”
read -e dbuser
echo “Database Password: ”
read -s dbpass
echo “run install? (y/n)”
read -e run
if [ "$run" == n ] ; then