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
/*{ | |
"author": "Anton Styagun", | |
"targets": ["omnifocus"], | |
"type": "action", | |
"identifier": "com.antonstyagun.planNextAction", | |
"version": "0.1", | |
"description": "Добавить действие \"Запланировать следующее действие\" с контекстом \"Мак\"", | |
"label": "Запланировать следующее действие", | |
"mediumLabel": "Запланировать следующее действие", | |
"paletteLabel": "Запланировать следующее действие", |
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/sh | |
# Use Vim in shell piped command chains | |
# https://gist.github.com/astyagun/952cb3b61b2d7d5e5d95b722d95bf428 | |
(vim - -esbnN -c "$@" -c 'w!/dev/fd/3|q!' >/dev/null) 3>&1 |
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
def dump_config | |
output = '' | |
Pry::ColorPrinter.pp(Rails.configuration, output, Pry::Terminal.width! - 1) | |
File.write 'current', output | |
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
#!/bin/sh | |
# Rebase a number of branches on top of one another | |
# https://gist.github.com/astyagun/0c9b0ea51ad9dd350c0d7326c364188f | |
# | |
# Given | |
# | |
# A---B---C | |
# / | |
# ----origin/A | |
# |
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/sh | |
if [ ! -d "$1" ]; then | |
echo \"$1\" is not a directory | |
exit 1 | |
fi | |
find "$1" -type d -maxdepth 1 | xargs -I{} sh -c 'echo `find {} -type f | wc -l` {}' | sort -nr |
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
{ | |
/* macOS Emacs-alike text editing shortcuts, including Russian keyboard layout | |
* Reference: | |
* - https://gist.github.com/zsimic/1367779 | |
* - http://xahlee.info/kbd/osx_keybinding.html | |
* - http://xahlee.info/kbd/osx_keybinding_action_code.html | |
* - http://osxnotes.net/keybindings.html | |
* - https://gist.github.com/cheapRoc/9670905 | |
* https://gist.github.com/astyagun/fe665b93d9b79da584b0b9b41106d862 */ |
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/sh | |
echo diffing file: ./$1 | |
mvim -d -f -c 'set columns=200' -c 'normal =' "$2" "$3" |
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/sh | |
# List Ruby gems, that are not a dependency of any other gem (analog of `brew leaves`) | |
# https://gist.github.com/astyagun/290b783045afffb8190a0c75ab76d0fa | |
GEMS_FILE=`mktemp` | |
DEPENDENCIES_FILE=`mktemp` | |
gem list -l | sed 's/ (.*//' | sort > $GEMS_FILE | |
cat $GEMS_FILE | xargs -n1 gem dependency -l --pipe | sed 's/ --version.*//' | sort -u > $DEPENDENCIES_FILE | |
comm -23 $GEMS_FILE $DEPENDENCIES_FILE |
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 -l | |
# tmux shell for macOS Terminal application | |
# | |
# Starts tmux taking current directory and open tmux sessions into account | |
# | |
# When Terminal starts, it's $PWD always equals $HOME. Except cases when Terminal application was told to open | |
# some particular directory (`open ~/Code -a Terminal` for instance). | |
# | |
# In the first case we want to attach to existing tmux session if one exists. If there is more than one | |
# session open, the script will ask user which session to attach to. |
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
SOURCE_DIRECTORY = File.expand_path raise 'Path to source directory is not set' | |
Dir.chdir SOURCE_DIRECTORY | |
TARGET_NAME = raise 'Target name is not set' | |
ARCHIVE_NAME = "#{TARGET_NAME}.zip" | |
TARGET_DIRECTORY = File.expand_path "../#{TARGET_NAME}" | |
ARCHIVE_TAGET_DIRECTORY = raise 'Archive target directory is not set' |
NewerOlder