Skip to content

Instantly share code, notes, and snippets.

View Bad-ptr's full-sized avatar

Constantin Kulikov Bad-ptr

View GitHub Profile
;;; common-mode-line.el --- mode-line common for all windows.
;; Copyright (C) 2017 Constantin Kulikov
;;
;; Author: Constantin Kulikov (Bad_ptr) <zxnotdead@gmail.com>
;; Version: 0.1
;; Package-Requires: ()
;; Date: 2017/01/24 16:22:13
;; License: GPL either version 3 or any later version
;; Keywords: frames, windows, mode-line, convenience
@Bad-ptr
Bad-ptr / helm-persp-bridge-v2.el
Last active July 31, 2022 11:52
persp-mode stuff
(with-eval-after-load "persp-mode"
(with-eval-after-load "helm-mode"
(defvar helm-mini-tail-sources (cdr helm-mini-default-sources))
(defvar helm-persp-completing-read-handlers
'((switch-to-buffer . helm-persp-buffer-list-bridge)
(kill-buffer . helm-persp-buffer-list-bridge)
(persp-kill-buffer . helm-persp-buffer-list-bridge)
(persp-temporarily-display-buffer . helm-persp-buffer-list-bridge)
(persp-add-buffer . helm-persp-buffer-list-bridge)
@Bad-ptr
Bad-ptr / editor.sh
Last active September 11, 2015 12:06
Open files in single emacs instance without daemon.
#!/bin/bash
if pidof emacs &> /dev/null; then
echo "$1" >> /tmp/emacs-files-to-find
else
emacs "$1"
fi
@Bad-ptr
Bad-ptr / .vimrc
Last active March 4, 2020 13:50
Vim settings, compatible with vim.tiny
scriptencoding utf-8
set nocompatible
"Basic Settings {{{1
" Encoding {{{2
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
" Text Wrapping {{{2
@Bad-ptr
Bad-ptr / compile_keymap.sh
Created October 26, 2014 14:46
compile xkb keymap
#! /bin/bash
xkbcomp -I$HOME/.xkb/ ~/.xkb/keymap/mykbd $DISPLAY &
@Bad-ptr
Bad-ptr / uncapslock.py
Created October 26, 2014 14:39
python, libx11, switch off caps
#!/usr/bin/env python
from ctypes import *
X11 = cdll.LoadLibrary("libX11.so.6")
display = X11.XOpenDisplay(None)
X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0))
X11.XCloseDisplay(display)
@Bad-ptr
Bad-ptr / on_ac_power.sh
Created October 14, 2014 17:45
Check if we on ac power or not.
#!/bin/sh
#
# Test if the computer is running on line power
# Exit status:
# - 0 (true) System is on AC power
# - 1 (false) System is not on AC power
#
# NOTE: Batteries are not good indicators unless we also check their type,
# as some peripherals have batteries.
#
@Bad-ptr
Bad-ptr / .bashrc
Created October 9, 2014 17:10
Must have.
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
@Bad-ptr
Bad-ptr / company-go.el
Created February 21, 2014 23:03
company-go with templates and signature in tooltip
;;; company-go.el --- company-mode backend for Go (using gocode)
;;; Code:
(eval-when-compile
(require 'cl)
(require 'company))
(defun company-go--invoke-autocomplete ()
(let ((temp-buffer (generate-new-buffer "*gocode*")))