Skip to content

Instantly share code, notes, and snippets.

View agzam's full-sized avatar
👀
Available for hire

Ag Ibragimov agzam

👀
Available for hire
View GitHub Profile
@l15n
l15n / git-branches-by-commit-date.sh
Created July 13, 2012 08:47 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit's author and author date for each branch. Sort by most recent commit's author date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r
@nikku
nikku / screencapture.md
Last active May 21, 2020 23:12
Animated Gif utility for X11 based systems

works badge

This is a simple script that allows you to choose an area that will be recorded into a 10s animated gif.

Usage

screencapture [dest-file]
@egh
egh / jabber-hipchat.el
Last active January 3, 2018 18:08
jabber.el hipchat setup
(require 's)
(require 'request)
(require 'seq)
(require 'jabber)
(defvar hipchat--user-info-for-completion nil)
(defcustom hipchat-nickname "Full name" "Hipchat real name (see see https://hipchat.com/account/xmpp)."
:type '(string)
@xificurC
xificurC / gist:34535c6c2d4a9d0c4f7a
Last active November 3, 2015 01:30
spacemacs prompt for kill-emacs
(advice-remove 'kill-emacs 'spacemacs-really-exit)
(defun ad-advice-kill-emacs (orig-fun)
"Prompt before killing."
(if (and (not spacemacs-really-kill-emacs)
(spacemacs/persistent-server-running-p))
(when (y-or-n-p "Really kill frame?")
(spacemacs/frame-killer))
(when (y-or-n-p "Really exit?")
(funcall orig-fun))))
(advice-add 'kill-emacs :around 'ad-advice-kill-emacs)
@metametadata
metametadata / core.cljs
Created November 2, 2017 10:11
ClojureScript read env in NodeJS
(defn -js->clj+
"For cases when built-in js->clj doesn't work. Source: https://stackoverflow.com/a/32583549/4839573"
[x]
(into {} (for [k (js-keys x)]
[k (aget x k)])))
(defn env
"Returns current env vars as a Clojure map."
[]
(-js->clj+ (.-env js/process)))
@gmpreussner
gmpreussner / archlinux-install-nvme-luks-lvm-btrfs-usb
Last active March 23, 2023 09:31
Minimal instructions for installing a fully encrypted ArchLinux with USB boot on Lenovo Yoga 920.
# Install a fully encrypted ArchLinux on NVMe with detached LUKS
# headers and LUKS encrypted UEFI boot partition on a USB dongle.
#
# Full tutorial can be found here:
# https://headcrash.industries/reference/fully-encrypted-archlinux-with-secure-boot-on-yoga-920/
#
# Written by Gerke Max Preussner <info@headcrash.industries>
# Overview ############################################################
@borkdude
borkdude / js_parser.clj
Last active August 6, 2023 22:14
Parse JavaScript in Clojure using the Google Closure Compiler
#!/bin/sh
#_(
"exec" "clojure" "-Sdeps" "{:deps {org.clojure/clojurescript {:mvn/version \"1.10.520\"}}}" "$0" "$@"
)
;; running js_parser.clj "function foo(x) { var y = x + 1; }" will print:
;; [{:type :function, :name "foo", :body [{:variable-statement [{:lvalue "y", :initializer {:type :binary-op, :left "x", :operator "+", :right "1"}}]}], :params ["x"]}]
@agzam
agzam / diff-buffers.el
Last active June 30, 2020 23:30
Diff two buffers
(defun diff-buffers (buffer-A buffer-B)
"Diff two buffers."
(interactive
(let* ((only-two? (eq 2 (count-windows)))
(wins (sort (window-list)
(lambda (a b) (< (window-use-time a)
(window-use-time b)))))
(b1 (if only-two?
(window-buffer (first wins))
(read-buffer "Buffer A to compare")))
@agzam
agzam / find-message.el
Last active June 30, 2020 23:30
Mu4e action to find a message in mailing list archives
;; If you subscribed to mailing list(s) in gnu.org or googlegroups.com
;; and using mu4e as your mailing app, very often you need to
;; find a message in lists.gnu.org/archive or googlegroups.com
;;
;; For example, when you don't have the context of a particular thread
;; and all prior messages got deleted locally.
;;
;; This mu4e action allows you
;; to quickly find selected email post in the archive
;; and open in the browser
@agzam
agzam / custom-org-insert-link.org
Last active June 30, 2020 23:29
Customize org-insert-link