Skip to content

Instantly share code, notes, and snippets.

View AhmedHelalAhmed's full-sized avatar
📱
Learning and developing

Ahmed Helal AhmedHelalAhmed

📱
Learning and developing
View GitHub Profile
@AhmedHelalAhmed
AhmedHelalAhmed / mongodb.txt
Created March 7, 2020 10:09
mongodb install ubuntu
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install -y mongodb
sudo apt-get install php-mongodb
#for test
mongo
<script>
window.addEventListener('DOMContentLoaded', function() {
$(document).ready(function () {
// here the code go
});
});
</script>
open .bashrc
add this configurations
# custom the title of the terminal
PROMPT_COMMAND="printf \"\033]0;%s\007\" \"You Can Do It\""
# custom terminal symbol
PS1='\[\033[1;34m\]pwd ⇒ (\w)\n'
PS1=${PS1}'\[\033[1;36m\]whoami ⇒ (\u)\n'
PS1=${PS1}'\[\033[1;33m\]hostname ⇒ (\h)\n'
@AhmedHelalAhmed
AhmedHelalAhmed / files.php
Created February 22, 2020 22:10
files in laravel
use Illuminate\Support\Facades\Storage;
// this will clear the file and put hello world
Storage::disk('local')->put('html.txt','hello world');
// this will append to the file
Storage::disk('local')->append('html.txt','hamada');
ssh [email protected]
cd /var/www/html/
@AhmedHelalAhmed
AhmedHelalAhmed / playground.json
Last active January 31, 2020 03:24
add function to array of objects in js
{
"scripts": [],
"showConsole": true
}
// names here like ahmed belong to the owner of the problem
let prtext = "Egy";
let ahmed = function() {
let a = Math.floor(Math.random() * prtext.length);
let b = "";
let whichRange = getRandomIntBetweenTwoValues(1, 2);
// to handle the critical values
if(a==0)
{
@AhmedHelalAhmed
AhmedHelalAhmed / index.html
Last active January 25, 2020 16:55
testplayground
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<div class="title">vuejs countries example: </div>
<select>
<option slected>Select country</option>
<option v-for="country in countries" :value="country.name">
@AhmedHelalAhmed
AhmedHelalAhmed / countries.js
Last active January 24, 2020 18:39
countries.js
[{"name":"AFGHANISTAN"},{"name":"ALBANIA"},{"name":"ALGERIA"},{"name":"AMERICAN SAMOA"},{"name":"ANDORRA"},{"name":"ANGOLA"},{"name":"ANGUILLA"},{"name":"ANTARCTICA"},{"name":"ANTIGUA AND BARBUDA"},{"name":"ARGENTINA"},{"name":"ARMENIA"},{"name":"ARUBA"},{"name":"AUSTRALIA"},{"name":"AUSTRIA"},{"name":"AZERBAIJAN"},{"name":"BAHAMAS"},{"name":"BAHRAIN"},{"name":"BANGLADESH"},{"name":"BARBADOS"},{"name":"BELARUS"},{"name":"BELGIUM"},{"name":"BELIZE"},{"name":"BENIN"},{"name":"BERMUDA"},{"name":"BHUTAN"},{"name":"BOLIVIA"},{"name":"BOSNIA AND HERZEGOVINA"},{"name":"BOTSWANA"},{"name":"BRAZIL"},{"name":"BRUNEI DARUSSALAM"},{"name":"BULGARIA"},{"name":"BURKINA FASO"},{"name":"BURUNDI"},{"name":"CAMBODIA"},{"name":"CAMEROON"},{"name":"CANADA"},{"name":"CAPE VERDE"},{"name":"CAYMAN ISLANDS"},{"name":"CENTRAL AFRICAN REPUBLIC"},{"name":"CHAD"},{"name":"CHILE"},{"name":"CHINA"},{"name":"CHRISTMAS ISLAND"},{"name":"COCOS (KEELING) ISLANDS"},{"name":"COLOMBIA"},{"name":"COMOROS"},{"name":"CONGO"},{"name":"CONGO, THE DEM