Skip to content

Instantly share code, notes, and snippets.

View thelbouffi's full-sized avatar

Taha EL BOUFFI thelbouffi

View GitHub Profile
@thelbouffi
thelbouffi / 1_install_arch_linux.txt
Last active June 22, 2019 21:53
install arch linux
=======================================================
I- Partitionate the disk
fdisk -l
fdisk /dev/sda
* boot partition
n -> p -> enter -> enter (defines first sector for boot partition by default 2048) -> 1002048 sectors (defines last sector for boot partition)
a (toogle boot) -> t (type) -> ef (EFI)
* disk parttion
n -> p -> enter -> enter (fst sector) -> enter (last sector)
* to see parttion table
@thelbouffi
thelbouffi / manage_vdi.txt
Last active July 5, 2019 12:05
virtualbox commands
to list vms:
vboxmanage list vms
to resize an existent vdi:
vboxmanage modifymedium disk 015319e5-4fbc-4437-83b0-cea42b2b21fe --resize 4096
as described on docs: https://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi

https://www.npmjs.com/package/npm-check-updates

to check packages => npm outdated
npm update will not always update all packages

solution => npm-check-updates upgrades your package.json dependencies to the latest versions, ignoring specified versions.

(for izmjs keep "path-to-regexp": "0.1.7")

@thelbouffi
thelbouffi / 01_fibonacci_no_memo.js
Last active February 27, 2021 01:14
Memoization
// fibonacci function without memoization
function fib(n) {
if (n === 0) return 0;
if (n === 1) return 1;
return fib(n - 2) + fib(n - 1);
}
const start = Date.now();
console.log(fib(42));
console.log(`Time consumed ${Date.now() - start} ms`);
@thelbouffi
thelbouffi / rules-to-write-better-commit-messages.md
Created December 15, 2021 20:21 — forked from medhatdawoud/rules-to-write-better-commit-messages.md
This gist is the summary of a video on YouTube [in Arabic] you can watch from here: https://youtu.be/BTlL-LBDCSI

Rules to write a better commit message

These are my preferences for a good commit message, feel free to fork this gist and add your own standards, or add comment here to share yours with the community.

1. Include only the files related to the feature you are implementing:

  • Don't add any file that is not related to the main issue, you can make it in a separate commit.
  • Separating files that not related is important in the revert cases.
  • Revise the whole changes always before committing and make sure to mention each change you made in the message.

2. Commit subject should be concise and reflect the essence of the commit:

  • Imagine the commit as an Email to the owner or your team mates.
  • Subject in the first and main sentence of the commit, it should be concise and to the point.
  • It shouldn't exceed 50 char.