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
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
//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
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
<VirtualHost *:80> | |
DocumentRoot "/Library/WebServer/Documents/appname" | |
ServerName appname.local | |
ServerAlias www.appname.local | |
ErrorLog "/private/var/log/apache2/appname.local.error" | |
CustomLog "/private/var/log/apache2/appname.local.custom" common | |
<Directory /Library/WebServer/Documents/appname/> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted |
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
#export branch to zip file | |
git archive --format zip --output /full/path/to/zipfile.zip master | |
#fix GIT issues | |
#Discarding all local commits on this branch | |
https://sethrobertson.github.io/GitFixUm/fixup.html#discard_all_unpushed |
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
//add your EC2 .pem file to ssh kys | |
ssh-add ~/aws/mypemfile.pem | |
//create bare repo on AWS EC2 webserver and deploy on demand | |
mkdir ~/git/the_project | |
cd ~/git/the_project | |
git init --bare | |
//create local repo and track remote one | |
cd ~/git/the_project |
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
#scp -i <keypair> myfile.txt [email protected]/home/ubuntu/myfile.txt |
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
#install | |
sudo apt-get install nginx | |
#remove default | |
sudo nano /etc/nginx/sites-available/default | |
sudo rm /etc/nginx/sites-enabled/default | |
#create new file | |
sudo nano /etc/nginx/sites-available/{appName} | |
server { | |
listen 80; |
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
tar -xvzf ./dump.tar.gz |