Skip to content

Instantly share code, notes, and snippets.

Gene Goykhman genegoykhman

Block or report user

Report or block genegoykhman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@genegoykhman
genegoykhman / ec.sh
Created Nov 3, 2019
Zsh shell function 'ec' for opening emacsclient in an sshd or mosh session
View ec.sh
#! /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 "$$"
else
@genegoykhman
genegoykhman / gist:c086db41b26e4cf9ca419aefdb874be4
Last active Nov 3, 2019
My custom Emacs font colors for dark themes
View gist:c086db41b26e4cf9ca419aefdb874be4
(custom-set-faces
'(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
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
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
#!/usr/bin/osascript
-- open-in-emacs.applescript
-- https://gist.github.com/genegoykhman/357bd6f64263e541c6f7
--
-- 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
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
genegoykhman / qb2ledger
Created Sep 22, 2012
Converts a QuickBooks General Journal CSV export to a ledger_cli compatible transaction file. More details at http://www.timetiger.com/gene/blog/2012/2012-09-23-an-alternative-to-quickbooks.html
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
You can’t perform that action at this time.