Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Pitometsu's full-sized avatar
🐫
∀:camel:.P(:camel:) → ∅ ≡ (∃:camel:.P(:camel:)) → ∅

Yuriy Pitomets Pitometsu

🐫
∀:camel:.P(:camel:) → ∅ ≡ (∃:camel:.P(:camel:)) → ∅
View GitHub Profile
@Pitometsu
Pitometsu / after.el
Created October 6, 2013 04:43
macro for lazy customizing el-get packages init-files
;; helper macro for multiply plugin interaction
(defmacro after (mode &rest body)
"`eval-after-load' MODE evaluate BODY."
(declare (indent defun))
`(if (featurep ,mode)
(progn ,@body)
(eval-after-load ,mode
'(progn ,@body))))
(font-lock-add-keywords 'emacs-lisp-mode
@Pitometsu
Pitometsu / insert-postfix-whitespace
Created October 22, 2013 14:14
postfix whitespace
;; insert postfix whitespace
(defun insert-postfix-whitespace ()
"Just insert SPC symbol next to point."
(interactive)
(save-excursion
(insert ?\s)
(backward-char)))
;; whitespace next to cursor
(global-set-key (kbd "S-SPC") 'insert-postfix-whitespace)
;; hack that enable major mode for newly created buffer according to `auto-mode-alist'
(defadvice set-buffer-major-mode (after new-buffer-auto-mode activate compile)
"Select major mode for newly created buffer.
Compare the `buffer-name' the entries in `auto-mode-alist'."
(with-current-buffer (ad-get-arg 0)
(if (and (buffer-name) (not buffer-file-name))
(let ((name (buffer-name)))
;; Remove backup-suffixes from file name.
(setq name (file-name-sans-versions name))
/*
* Nekoboard code
*
* by: Yuriy Pitomets
* license: GNU GPL v. 3
*
*/
const char Key_LEFT_CTRL = 0x80;
;; eshell prompt
(setq eshell-prompt-function
(lambda ()
(let ((user-uid-face (if (zerop (user-uid))
'((t (:inherit (eshell-ls-missing eshell-prompt bold))))
'((t (:inherit (eshell-ls-directory eshell-prompt bold)))))))
(concat
(propertize (or (ignore-errors
(format "[%s] "
@Pitometsu
Pitometsu / tmux_manager.sh
Created October 18, 2014 00:46
manage tmux, put at end of ~/.zshrc or ~/.bashrc
#!/bin/bash
# manage Tmux
if [ -n "$TMUX" ]; then # in tmux
if [ -n "$COLORTERM" ]; then # in rich VT
export TERM=xterm-256color-italic
fi
elif tmux list-sessions &> /dev/null; then
tmux attach &> /dev/null # try to attach
@Pitometsu
Pitometsu / gist:ae404938d4f69a51a9b4
Created November 3, 2014 18:37
cave resolve dev-scm/darcs
20:35 Mon 2014-11-03 ~ ] cave resolve dev-scm/darcs
Done: 616 steps
These are the actions I will take, in order:
s dev-haskell/array:0.4.0.1::haskell 0.4.0.1 to ::installed
"Mutable and immutable arrays"
doc -hscolour -profile build_options: symbols=compress jobs=9 dwarf_compress -recommended_tests -trace work=tidyup
Reasons: dev-scm/darcs-2.8.4-r1:2.8.4::haskell
# git
git config --global color.ui true
git config --global user.name "Yuriy Pitomets"
git config --global user.email pitometsu@gmail.com
git config --global push.default simple
git config --global gpg.program gpg2
git config --global user.signingkey $MY_GPG_ID
git config --global commit.gpgsign true
git config --local core.sshCommand "ssh -i ~/.ssh/id_rsa_corp"
git config --global rebase.autosquash true
-- Code challenge.
{-# LANGUAGE NPlusKPatterns #-}
import Control.Monad (guard, liftM)
revert :: Int -- | digit
-> Int -- | with radix
-> Int -- | reverse digit
revert d r = revert' 0 d
@Pitometsu
Pitometsu / skypeid
Created January 6, 2015 11:13
my skype id
pitometsu