Skip to content

Instantly share code, notes, and snippets.

@sanrandry
sanrandry / change local folder git config.md
Last active November 1, 2022 09:10
change local folder git config

Go to the folder you want to change the git config

cd YourFlolder

If you need to change the name

git config user.name "Your name"
@sanrandry
sanrandry / clean_code.md
Created September 2, 2022 15:01 — forked from cedrickchee/clean_code.md
Summary of "Clean Code" by Robert C. Martin

Summary of "Clean Code" by Robert C. Martin

A summary of the main ideas from the "Clean Code: A Handbook of Agile Software Craftsmanship" book by Robert C. Martin (aka. Uncle Bob).

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

@sanrandry
sanrandry / clean_code.md
Created September 2, 2022 14:57 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@sanrandry
sanrandry / note.md
Created March 8, 2022 07:00
add current git branch to a bash terminal
@sanrandry
sanrandry / fix-ntfs-not-mounting.md
Created February 2, 2022 05:55
fix ntfs not monting linux dual boot windows

Use ntfsfix

  • list disk
    sudo fdisk -l
  • user ntfsfix command
sudo ntfsfix /dev/sdaX

with sdaX is the device in NTFS

@sanrandry
sanrandry / note.md
Last active November 23, 2022 06:20
Debian mico noise canceling pulse audion

Debian micro noise canceling pulse audio

Add this line to /etc/pulse/default.pa

load-module module-echo-cancel source_name=noechosource sink_name=noechosink
set-default-source noechosource
set-default-sink noechosink

restart pulse audio

@sanrandry
sanrandry / gitlab community edition installation ruby wait error.md
Created November 3, 2021 12:00
gitlab community edition installation ruby wait error

if you have this error

 * link[/opt/gitlab/service/redis] action create
  - create symlink at /opt/gitlab/service/redis to /opt/gitlab/sv/redis
 * ruby_block[wait for redis service socket] action run

execute this command on the server in another terminal

systemctl start gitlab-runsvdir.service
@sanrandry
sanrandry / caculate_navbar_height.md
Last active September 19, 2023 15:24
calculate navbar height
  • add this javascript
document.documentElement.style.setProperty('--nav-height', document.getElementById("navbar").offsetHeight);
  • use property iny css
:root {
    --nav-height: 70px; /*You HAVE To Give A Default Fallback Value*/
}
@sanrandry
sanrandry / Disable wyland for skype or screen sharing error.md
Last active March 10, 2022 08:29
Disable wyland for skype or screen sharing error

Disable wyland for skype or screen sharing error

cd /etc/gdm3/
sudo vim daemon.conf

unocoment the line: WaylandEnable=false

@sanrandry
sanrandry / 5.py
Created February 2, 2021 04:47
python reminder
from time import time, sleep
import subprocess
while True:
bashCommand = "zenity --notification --text='5'"
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate()
sleep(60 * 5)