Skip to content

Instantly share code, notes, and snippets.

@jadient
jadient / ClipHist4.ahk
Last active March 26, 2022 04:59
Simple Clipboard History for Windows
;; ClipHist4 - ClipBoard History using AutoHotkey
;;
;; From:
;; https://tinyurl.com/cliphist4
;;
;; Based on:
;; https://www.autohotkey.com/board/topic/87650-clipboard-history-menu-decrementing-numbered-circular-buckets/
;; with customizations and modernization
;;
;; About ClipHist4:
@jadient
jadient / .bashrc
Created February 12, 2018 04:55
.bashrc snippet
if [[ -n $EMACS ]]; then
# inside emacs
echo ".bashrc: inside emacs"
alias e='emacsclient -a "" -n "$@"'
elif [[ -n $SSH_TTY ]]; then
# ssh/remote, use terminal mode
alias e='emacsclient -a "" -t "$@"'
else
# local/gui
alias e='emacsclient -a "" -n "$@"'
@jadient
jadient / .emacs
Created February 11, 2018 01:12
.emacs on linux
;; .emacs
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(diff-switches "-u")
'(menu-bar-mode -1)
'(tool-bar-mode nil))
@jadient
jadient / .emacs
Last active February 11, 2018 01:13
.emacs on windows
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
# with difftool, choose which files to diff
git difftool --dir-diff
@jadient
jadient / git config
Last active November 11, 2017 20:52
# use --global or --system options to specify other configuration locations
# -- global is per user, --system is for all users
git config status.showUntrackedFiles no
# https://chodounsky.net/2013/05/01/compare-files-with-git-diff-tool/
git config color.status.added "cyan normal bold"
git config color.status.changed "cyan normal bold"
git config color.status.untracked "cyan normal bold"
git config color.diff.old "red normal bold"
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
Disable-UAC
cinst bitdefenderavfree
cinst googlechrome
cinst sublimetext3
cinst classic-shell
cinst sysinternals
@jadient
jadient / console.py
Created March 8, 2015 21:32
python open interactive console (for debugging) from Tomasz Ducin
"""
Console module provide `copen` method for opening interactive python shell in
the runtime.
http://sys-exit.blogspot.com/2013/12/python-open-interactive-console.html
Usage:
import console
console.copen(globals(), locals())
@jadient
jadient / python-batchfile.bat
Last active June 21, 2024 08:48
Run python code directly from a batch file
@echo off & python -x "%~f0" %* & goto :eof
# ==========================================================
# one way to place python script in a batch file
# place python code below (no need for .py file)
# ==========================================================
import sys
print "Hello World!"
for i,a in enumerate(sys.argv):
@jadient
jadient / inputwrapper.py
Last active August 29, 2015 13:57
python wrapper: convert input source to line generator
"""
Convert an input source (file, string, or file descriptor)
into a generator that provides a line at a time.
Online challenges provide input on stdin, but for testing,
it can be useful to provide input via a file or a string.
This wrapper takes any of these formats and returns an
iterator that will provide the input a line at a time.
"""
def input_from_string(data):