Skip to content

Instantly share code, notes, and snippets.

View strip-silence.rb
#! /usr/bin/env ruby
# strip-silence version 1.0
# Usage:
# strip-silence input.mp4
# Description:
# Uses auto-editor to identify areas of silence in input.mp4,
# then uses ffmpeg to strip them out (without recompression).
genegoykhman / multi-tty.patch
Created Dec 6, 2020
Fix support for macOS multi-tty in Emacs 27.1
View multi-tty.patch
diff --git a/lisp/server.el b/lisp/server.el
index 5efba17a01..c194d78ad1 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -1182,10 +1182,9 @@ The following commands are accepted by the client:
;; choice there.) In daemon mode on Windows, we can't
;; make tty frames, so force the frame type to GUI
;; there too.
- (when (or (and (eq system-type 'windows-nt)
- (or (daemonp)
genegoykhman /
Created Nov 3, 2019
Zsh shell function 'ec' for opening emacsclient in an sshd or mosh session
#! /bin/zsh
function pid_has_ancestor_server() {
pstree -p $1 | grep $2
function pid_of_shell_process() {
if is_not_inside_local_tmux; then
echo "$$"
genegoykhman / gist:c086db41b26e4cf9ca419aefdb874be4
Last active Nov 3, 2019
My custom Emacs font colors for dark themes
View gist:c086db41b26e4cf9ca419aefdb874be4
'(default ((t (:stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :family "Source Code Pro for Powerline"))))
'(line-number ((t (:foreground "#485e65" :background "#081e25" :height 0.8))))
'(magit-mode-line-process ((t (:inherit mode-line-emphasis :foreground "yellow"))))
'(markdown-comment-face ((t (:foreground "#586e75" :strike-through nil))))
'(mu4e-view-body-face ((t (:foreground "#ffffff"))))
'(smerge-upper ((((class color) (min-colors 88) (background light))
:background "#ffdddd")
(((class color) (min-colors 88) (background dark))
:background "#330000")
genegoykhman / Blitz Talk.scpt
Created Jun 24, 2016
Auto-advance a Deckset presentation 15-seconds per slide
View Blitz Talk.scpt
tell application "Deckset"
set doc to first document
set ind to 0
set slideIndex of doc to ind
set delaySeconds to 15
--set question to display dialog "Start presentation?" buttons {"OK", "Cancel"} default button 1
--set answer to button returned of question
--if answer is equal to "OK" then
genegoykhman / open-in-emacs.applescript
Last active Aug 25, 2016
My QuickCursor replacement, opening the selected text (or full document) in Emacs client for editing
View open-in-emacs.applescript
-- open-in-emacs.applescript
-- By Gene Goykhman, 2016
-- No warranties expressed or implied: use at your own risk.
-- When triggered by a system-wide hotkey, opens the selected text (if any) or the full document in your frontmost application in an Emacs client buffer. When you exit the buffer the edited text replaces the selection (or full document).
-- Installation
genegoykhman / gist:4514089
Created Jan 11, 2013
Modified create_mail routine in Mail.scpt of the QuickSilver Apple Mail support plugin that includes mail signatures in new messages you create. The first signature with the name "Default" or "Quicksilver" is used.
View gist:4514089
on create_mail(theSubject, theBody, theSender, theRecipients, thePaths)
tell application "Mail"
set theMessage to (make new outgoing message at the beginning of outgoing messages with properties {subject:theSubject, content:theBody})
repeat with i from (count of theRecipients) to 1 by -1
tell theMessage to make new to recipient at beginning of to recipients with properties {address:(item i of theRecipients)}
end repeat
if (theSender is not missing value) then set sender of theMessage to theSender
end tell
if (thePaths is not missing value) then
set theAliases to my aliasesForPaths(thePaths)
genegoykhman / qb2ledger
Created Sep 22, 2012
Converts a QuickBooks General Journal CSV export to a ledger_cli compatible transaction file. More details at
View qb2ledger
#! /usr/bin/env ruby
require 'csv'
require 'Date'
require 'optparse'
SCRIPT_VERSION = [1, 0, 0]
class Transaction
attr_accessor :transaction_id, :type, :date, :num, :rows
def initialize