This file contains hidden or 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
RewriteEngine on | |
# If an existing asset or directory is requested go to it as it is | |
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] | |
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d | |
RewriteRule ^ - [L] | |
# If the requested resource doesn't exist, use index.html | |
Options +FollowSymLinks |
This file contains hidden or 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
//TODO use regex | |
let enAlphabet = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); | |
let arAlphabet = 'ض ص ث ق ف غ ع ه خ ح ش س ي ب ل ا ت ن م ئ ء ؤ ر لا ى ة و ز ظ ط ك د ج'.split(' '); //TODO update the list | |
let resutls = document.querySelectorAll(".post p"); | |
resutls.forEach(function(post){ | |
let arScore = 0; | |
let enScore = 0; | |
let postText = post.textContent.trim(); | |
if (postText.length < 1) { | |
return; |
This file contains hidden or 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
sudo apt-get update | |
sudo apt-get install git | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
sudo apt-get update | |
sudo apt-get install docker-ce |
This file contains hidden or 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
#from https://stackoverflow.com/questions/41322541/rebuild-docker-container-on-file-changes | |
#!/bin/bash | |
imageName=app | |
containerName=app-container | |
docker build -t $imageName -f Dockerfile . | |
echo Delete old container... | |
docker rm -f $containerName |
This file contains hidden or 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
var domain = window.location.hostname; | |
console.log('Welcome to console.chat! You\'re chatting with other people who visited ' + domain + ' and opened their browser\'s console!'); | |
console.log('To send a message it must be in this format: send(\'your message here\')\nExample: If you want to say "Hey, what\'s up?" send(\'Hey, what\'s up?\')'); | |
console.log('Created by @DaltonEdwards :)'); | |
var messageCount = 0; | |
function loadMessages() { | |
var request = new XMLHttpRequest(); | |
request.open('GET', 'https://console.chat/api/read.php?domain=' + domain, true); | |
request.onload = function() { | |
if (request.status >= 200 && request.status < 400) { |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"sync" | |
"strconv" | |
"net/http" | |
"io/ioutil" | |
) | |
var wg sync.WaitGroup |
This file contains hidden or 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
https://www.digitalocean.com/community/tutorials/how-to-acquire-a-let-s-encrypt-certificate-using-dns-validation-with-certbot-dns-digitalocean-on-ubuntu-20-04 | |
https://www.humankode.com/ssl/how-to-set-up-free-ssl-certificates-from-lets-encrypt-using-docker-and-nginx | |
-> https://certbot-dns-digitalocean.readthedocs.io/en/stable/ | |
certbot certonly --dns-digitalocean --dns-digitalocean-credentials ~/digitaloceanapikey.ini --preferred-challenges=dns -d=example.com -d=*.example.com | |
nano /etc/nginx/sites-available/x-app | |
ln -s /etc/nginx/sites-available/x-app /etc/nginx/sites-enabled/x-app | |
sudo service nginx configtest | |
sudo service nginx restart |
This file contains hidden or 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
var ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; | |
var stop = false; | |
function go(index, step) { | |
if (stop) { | |
console.log('Stoped', index, step); | |
return; | |
} | |
if (index > ids.length) { | |
console.log('Done'); |
This file contains hidden or 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
REPO_TAG=3.0.0 | |
all: build | |
i18n-nodejs-$(REPO_TAG): | |
curl https://github.com/eslam-mahmoud/i18n-nodejs/archive/$(REPO_TAG).zip -L -o i18n-nodejs-$(REPO_TAG).zip | |
unzip i18n-nodejs-$(REPO_TAG).zip | |
build: i18n-nodejs-$(REPO_TAG) | |
cd i18n-nodejs-$(REPO_TAG); npm install |
This file contains hidden or 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=executable | |
VERSION=1 | |
GO_IMAGE=eslammahmoud/test:$(VERSION) | |
# Docker container that will be used to create the vendor folder and binary | |
GO_ENV=docker run -it --rm -v $(PWD):/app -w /app golang:1.8 | |
all: push | |
# Create the executable file |