This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-magit-commit-and-rebase-fixup () | |
"Создать временный коммит из staged изменений и объединить с предыдущим коммитом." | |
(interactive) | |
;; Проверяем наличие staged изменений | |
(when (not (magit-anything-staged-p)) | |
(user-error "Nenio ŝanĝoj estas en la 'staged'")) | |
;; Проверяем наличие коммитов в истории | |
(when (not (magit-rev-verify "HEAD")) | |
(user-error "Nenio ŝanĝoj estas en la historio")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-magit-backup-branch () | |
"Backup current Git branch with predefined name based on the date." | |
(interactive) | |
(let* ((current-branch (magit-get-current-branch)) | |
(branch-name (format "backup-%s-%s" current-branch (format-time-string "%y-%m-%d-%H-%M" (current-time))))) | |
(magit-run-git "branch" "-d" branch-name) | |
(magit-run-git "checkout" "-b" branch-name current-branch) | |
(magit-run-git "push" "--force" "origin" branch-name) | |
(magit-checkout current-branch))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun my-magit-push-as-another-branch () | |
"Recreate a Magit branch by deleting and creating a new one with branch name completion." | |
(interactive) | |
(let* ((branches (split-string (car (magit-git-items "for-each-ref" "--format=%(refname:short)" "refs/heads/")) "\n")) | |
(branch-name (ivy-read "Enter branch name: " branches | |
:require-match t | |
:preselect (magit-get-current-branch) | |
:sort nil)) | |
(current-branch (magit-get-current-branch))) | |
(when (yes-or-no-p (format "Recreate & push branch \"%s\"?" branch-name)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Not for copypaste! It is only part of keymap.c! | |
// You should adapt the code above for your keyboard especially for your layers. | |
// WARNING! You could be banned in Valve games because the feautre treated by Valve as a cheat. | |
// | |
// It uses two user hooks: layer_state_set_user() and process_record_user() as defined by QMK. | |
// Example enum with layers. | |
enum layers { | |
DEFAULT_LAYER, | |
GAME_LAYER, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'ansi-color) | |
;; Shows haredoc for the selected or word. | |
(defun haredoc () | |
"Run the haredoc with the current word under the cursor and display | |
the results in a new buffer." | |
(interactive) | |
(let* ((current-word | |
(if (use-region-p) ;; Use region or the current word | |
(setq current-word (buffer-substring-no-properties (region-beginning) (region-end))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copypaste it to your ~/.config/sway/config | |
set $TBALL 1149:4128:Kensington______Kensington_Expert_Mouse | |
# Turns on scrolling with the ball when right bottom button pressed. | |
input $TBALL { | |
scroll_method on_button_down | |
scroll_button 273 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo cpupower frequency-set -g performance >/dev/null | |
xrandr --output HDMI-0 --mode 1920x1080 --rate 60 --primary --output DVI-I-1 --off | |
feh -d --recursive --randomize --bg-scale /usr/share/backgrounds /usr/share/wallpapers 2>/dev/null | |
killall compton | |
nvidia-settings -l | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"path" | |
"path/filepath" | |
"strings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"path" | |
"path/filepath" | |
"strings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# It uses fzf: https://github.com/junegunn/fzf | |
function fcd | |
cd ~ | |
if [ (count $argv) -ge 1 ] | |
cd (dirname (fzf -q "$argv")) | |
return | |
end | |
cd (dirname (fzf)) | |
end |
NewerOlder