Skip to content

Instantly share code, notes, and snippets.

View bouyagas's full-sized avatar
🏠
Working from home

Mohamed Bouyagui Gassama bouyagas

🏠
Working from home
View GitHub Profile
@bouyagas
bouyagas / vanilla-js-cheatsheet.md
Created August 20, 2019 09:14 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@bouyagas
bouyagas / postgres-cheatsheet.md
Created March 11, 2019 21:30 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@bouyagas
bouyagas / Readme.md
Created October 9, 2018 06:09 — forked from ErikCH/Readme.md
@bouyagas
bouyagas / docker-help.md
Created August 21, 2018 02:11 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@bouyagas
bouyagas / webdev_online_resources.md
Created July 17, 2018 06:30 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@bouyagas
bouyagas / ssh.txt
Created July 14, 2018 09:31 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets
# Login via SSH with password (LOCAL SERVER)
> ssh brad@192.168.1.29
# Create folder, file, install Apache (Just messing around)
mkdir test
cd test
touch hello.txt
sudo apt-get install apache2
# Generate Keys
@bouyagas
bouyagas / FizzBuzz.js
Created June 4, 2018 08:51 — forked from jaysonrowe/FizzBuzz.js
FizzBuzz JavaScript solution
for (var i=1; i <= 20; i++)
{
if (i % 15 == 0)
console.log("FizzBuzz");
else if (i % 3 == 0)
console.log("Fizz");
else if (i % 5 == 0)
console.log("Buzz");
else
console.log(i);
@bouyagas
bouyagas / jsPrime
Created May 23, 2018 02:19 — forked from sarathsaleem/jsPrime
JavaScript Prime number with recursion
function isPrime(n, hn) {
if (hn === 0 || n === 1) {
return true;
}
hn = hn || parseInt(n / 2);
if (n % hn === 0 && hn !== 1) {
return false;
} else {
return isPrime(n, hn - 1);
}
@bouyagas
bouyagas / jsPrime
Created May 23, 2018 02:19 — forked from sarathsaleem/jsPrime
JavaScript Prime number with recursion
function isPrime(n, hn) {
if (hn === 0 || n === 1) {
return true;
}
hn = hn || parseInt(n / 2);
if (n % hn === 0 && hn !== 1) {
return false;
} else {
return isPrime(n, hn - 1);
}
@bouyagas
bouyagas / median.js
Created May 23, 2018 02:18 — forked from caseyjustus/median.js
calculate the median of an array with javascript
function median(values) {
values.sort( function(a,b) {return a - b;} );
var half = Math.floor(values.length/2);
if(values.length % 2)
return values[half];
else
return (values[half-1] + values[half]) / 2.0;