Skip to content

Instantly share code, notes, and snippets.

View melboudali's full-sized avatar

Mohamed EL BOUDALI melboudali

View GitHub Profile
@melboudali
melboudali / heroku.md
Last active August 5, 2021 21:10
heroku-cli

heroku logo

Heroku-CLI

Login & Create react app application:

  1. Login with your Heroku account
heroku login
@melboudali
melboudali / PostgreSQL cheat sheet
Last active March 13, 2021 21:37
PostgreSQL cheat sheet
$psql -U <username> => logs in with username and password (default: postgres).
$CREATE DATABASE <databaseName>; => create new database (databaseName).
$DROP DATABASE <databaseName>; => drop/Delete database (databaseName).
$DELETE FROM table WHERE id = 1; => delete row from table.
$DELETE FROM table WHERE id IN (6,5); => delete multiple rows from the table.
$SELECT * FROM "user"; => Select users from user table;
$\l => list databases.
$\d => list tables, views, and sequences.
$\connect [or] \c <databaseName> => connect to a database <databaseName>.
$\c postgres => disconnect from a database.
@melboudali
melboudali / git.md
Last active June 19, 2022 16:16
Git Cheatsheet

logo

Git Cheatsheet

This is my git cheatesheet with the most used commands.

Basics

  • Create a new Git repo with a branch named "main":
@melboudali
melboudali / onCopy.js
Last active September 24, 2020 13:54
Copy text with extra infos.
const ReactFunc = () => {
const onCopy = e => {
e.preventDefault();
const Signature = `Copied from: https://gist.github.com/MedElBoudali/4e82ea15571db42c99246f95479cabab`;
e.clipboardData.setData('text', `\n${document.getSelection()} \n${Signature}\n`);
};
return (
<h1 onCopy={onCopy}>
👋 Hello World!
</h1>
@melboudali
melboudali / Docker.txt
Last active July 12, 2020 23:23
docker
#use https://hub.docker.com/ to find official images.
#In Toolbox, nothing will be localhost, and will be 192.168.99.100 by default, since it's running a Linux VM in VirtualBox.
#Then going to http://192.168.99.100 should work.
#If you are finished using a host for the time being, you can stop it with docker-machine stop and later start it again with docker-machine start:
> docker-machine stop default
> docker-machine start default
#To list available machines:
@melboudali
melboudali / Styled-Components.js
Last active July 16, 2020 15:57
Media queries for styled-components
const size = {
esmall: '576px',
small: '576px',
medium: '768px',
large: '992px',
elarge: '1200px'
};
export const extraSmallDevices = `@media only screen and (max-width: ${size.esmall})`;
export const smallDevices = `@media only screen and (min-width: ${size.small})`;