Skip to content

Instantly share code, notes, and snippets.

View kebairia's full-sized avatar
🕶️

Zakaria Kebairia kebairia

🕶️
View GitHub Profile
#!/bin/bash
# Author: Zakaria Kebairia
# Email: 4.kebairia@gmail.com
#
# Description: This script prompts the user to select a prompt from a fil
# Set shell options:
# e: Exit immediately if a command exits with a non-zero status code,
# u: Treat unset variables as an error,
@kebairia
kebairia / movements_and_rotations.py
Last active December 22, 2021 16:43
playing with manim (movements and rotations)
from manim import *
import random
class Samples(Scene):
_bg = "#282828"
font_size = 30
font_size_samples = 10
label_font_size = 20
squares = 10
@kebairia
kebairia / create-blog.el
Last active November 9, 2021 21:34
i'm using Emacs and org mode to create my blog posts, so why don't i automate the process !it's Emacs after all!
;; I took `capitalize-first-char` function from here ↙↙
;; https://emacs.stackexchange.com/a/12614
(defun zk/capitalize-first-char (&optional string)
"Capitalize only the first character of the input STRING."
(when (and string (> (length string) 0))
(let ((first-char (substring string nil 1))
(rest-str (substring string 1)))
(concat (capitalize first-char) rest-str))))
@kebairia
kebairia / init-fast-startup-emacs.el
Created June 20, 2021 15:21
Faster Startup for your Emacs
;; gc-cons-threshold is the number of bytes of consing before a garbage collection is invoked. It’s normally set at 800,000 bytes, but for me that invokes the GC 39 times!!! during startup (gcs-done) , and the GC is sloooow. I’ve set it to ~384M above. And now no GC invocations during startup. source: 2 easy little known steps to speed up Emacs start up time
;; reset the gc-cons-threshold to its defaults values after startup
;; **Faster Startup**
;; Speed up startup
(setq gc-cons-threshold 402653184
gc-cons-percentage 0.6)
(add-hook 'after-init-hook
`(lambda ()
(setq gc-cons-threshold 800000
gc-cons-percentage 0.1)