Skip to content

Instantly share code, notes, and snippets.

Avatar
👾
Focusing

Alper Alimoglu avatar-lavventura

👾
Focusing
View GitHub Profile
@avatar-lavventura
avatar-lavventura / install_emacs.sh
Last active Mar 23, 2022
How to install GccEmacs
View install_emacs.sh
dpkg -l | grep emacs | awk '{print $2}' | xargs -n1 sudo apt-get purge -y
sudo apt autoremove -y
sudo apt install -y autoconf libgif-dev libtiff5-dev libgnutls28-dev libncurses5-dev \
libgif-dev libharfbuzz-bin imagemagick libmagickwand-dev gcc \
libharfbuzz-dev libharfbuzz-bin imagemagick libmagickwand-dev libgccjit-10-dev \
libgccjit0 gcc-10 libjansson4 libjansson-dev xaw3dg-dev texinfo libx11-dev
mkdir ~/git && cd ~/git
git clone git://git.savannah.gnu.org/emacs.git
cd emacs && git checkout emacs-28
export CC=/usr/bin/gcc-10 CXX=/usr/bin/gcc-10 && ./autogen.sh
@avatar-lavventura
avatar-lavventura / git-get-files-by-size.py
Created Sep 2, 2021 — forked from punkdata/git-get-files-by-size.py
Git this script lists the files that are larger than the size you specify. Example use: python git-find-big-files.py fix-remove-files 1000000 (file size in MBs)
View git-get-files-by-size.py
#!/usr/bin/python
# run the script: python git-find-big-files.py <the branch> <file size>
# Example use: python git-find-big-files.py fix-remove-files 1000000 (this value equals 1 Megabyte)
# the Fix-remove-files specifies the branch that you are cleaning
import os, sys
def getOutput(cmd):
return os.popen(cmd).read()
View zprofile
## History file configuration
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
[ "$HISTSIZE" -lt 50000 ] && HISTSIZE=50000
[ "$SAVEHIST" -lt 10000 ] && SAVEHIST=10000
## History command configuration
setopt extended_history # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups # ignore duplicated commands history list
setopt hist_ignore_space # ignore commands that start with space
View debug
❯ unset ALTERNATE_EDITOR
❯ echo $ALTERNATE_EDITOR
❯ rm -f /tmp/emacs1002/server
❯ cat /tmp/emacs1002/server
cat: /tmp/emacs1002/server: No such file or directory
❯ emacsclient -t
emacsclient: can't find socket; have you started the server?
emacsclient: To start the server in Emacs, type "M-x server-start".
emacsclient: No socket or alternate editor. Please use:
View debug_error
Debugger entered: nil
(progn (debug))
(if (equal (car (last (split-string filename "[/\\]") 2)) "obsolete") (progn (debug)))
debug-on-load-obsolete("/usr/share/emacs/26.3/lisp/obsolete/yow.elc")
run-hook-with-args(debug-on-load-obsolete "/usr/share/emacs/26.3/lisp/obsolete/yow.elc")
do-after-load-evaluation("/usr/share/emacs/26.3/lisp/obsolete/yow.elc")
require(yow nil t)
eval-buffer(#<buffer *load*-487072> nil "/home/alper/.emacs.d/lisp/icicles/icicles-cmd1.el" nil t) ; Reading
at buffer position 21
load-with-code-conversion("/home/alper/.emacs.d/lisp/icicles/icicles-cmd1.el"
View gist:bc262bcd8fefa746fe6eb84e0e5aa194
#!/bin/bash
# https://stackoverflow.com/questions/35800082/how-to-trap-err-when-using-set-e-in-bash
RED="\033[1;31m"
GREEN="\033[1;32m"
NC="\033[0m" # No Color
function func(){
View git_commit_template.txt
# 1. `Separate subject from body with a blank line`
# 2. `Limit the subject line to 50 characters`
# 3. `Capitalize the subject line`
# 4. `Do not end the subject line with a period`
# 5. `Use the imperative mood in the subject line`
# 6. `Wrap the body at 72 characters`
# 7. `Use the body to explain what and why vs. how`