Skip to content

Instantly share code, notes, and snippets.

View HachemiH's full-sized avatar

Hachemi HachemiH

View GitHub Profile
@HachemiH
HachemiH / format.sh
Created September 13, 2024 19:08 — forked from garethrees/format.sh
Format USB drive from the command line macOS
diskutil list
diskutil unmountDisk /dev/disk2
diskutil eraseDisk FAT32 SANDISK /dev/disk2
@HachemiH
HachemiH / debugging.md
Created October 28, 2022 19:54 — forked from glebec/debugging.md
Debugging

Debugging JavaScript Applications

A practical distillation for Fullstack Academy students

Faults in computer problems were theorized as far back as 1843, when Ada Lovelace noted of Babbage's Analytical Engine, "Granted that the actual mechanism is unerring in its processes, the cards may give it wrong orders." Almost 160 years later, NIST reported that software errors cost the US $59 billion annually. Clearly, some of the cards are wrong. However, unlike Grace Hopper's famous moth, most of the time the culprit is ourselves.

Debugging is a sanitization procedure consisting of:

  • Preventing bugs in the first place, through good practices and assistive tooling.
  • Detecting bugs when they first arise, through proper error handling and testing.
# Default server configuration
#
server {
listen 80;
# server_name default_server;
listen 443 ssl;
server_name toto.fr www.toto.fr;
@HachemiH
HachemiH / toto.fr
Created January 18, 2016 23:31
Fichier Vhost toto.fr Nginx
server {
listen 80;
server_name toto.fr www.toto.fr;
root /home/toto/www;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
@HachemiH
HachemiH / default
Last active January 18, 2016 20:50
Default file Nginx
server {
listen 80;
server_name your_site_name.com;
root /usr/share/nginx/html;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;