Skip to content

Instantly share code, notes, and snippets.

View mskorzhinskiy's full-sized avatar

Mikhail Skorzhinskii mskorzhinskiy

View GitHub Profile
@mskorzhinskiy
mskorzhinskiy / save-table.lua
Last active October 24, 2015 16:13
Table serialization to file for Alan
function table_save(table, filename)
local file = fs.open("w", filename)
local data = textutils.serialize(table)
file.write(data)
file.close()
end
function table_load(filename)
local file = fs.open("r", filename)
local data = file.readAll()
@mskorzhinskiy
mskorzhinskiy / weird.el
Created January 5, 2016 19:07
Weird thing
;; Common use of third-party function looks like that:
(evilified-state-evilify-map
:mode some-emacs-mode
:bindings
(kdb "C-c a") 'function1
(kdb "C-c b") 'function2)
;; I want to declare function or macro that will produce such bindings
@mskorzhinskiy
mskorzhinskiy / lang.el
Created February 24, 2016 20:30
Snippet for setting language
(defun set-russian-language ()
(interactive)
(set-input-method "russian-computer")
(ispell-change-dictionary "ru"))
(defun set-english-language ()
(interactive)
;; todo remove this ugly hack someday
(set-input-method "russian-computer")
@mskorzhinskiy
mskorzhinskiy / scanf.c
Created February 25, 2016 07:51
Reading from input
#define STRING_MAX_LENGTH 256
void read_some_input_snipper {
char *result;
char *name;
char buf[STRING_MAX_LENGTH];
fgets(buf, sizeof(buf), stdin);
ssprintf(buf, "%s%[^\n]", name, result);
}
@mskorzhinskiy
mskorzhinskiy / vimrc.vim
Created December 4, 2016 17:37
My old vimrc file (used for Perl projects)
""""""""""""""""""""""""""""""""""""""""""""""""
" File: .vimrc "
" Create Date: Nov 04, 2010 "
" Author: Michail Skorzinskiy "
" email : rasmikun@gmail.com "
" jabber: rasmikun@gmail.com "
""""""""""""""""""""""""""""""""""""""""""""""""
@mskorzhinskiy
mskorzhinskiy / rofi-help.txt
Created January 30, 2017 13:37
Rofi configuration for bug report
rofi usage:
rofi [-options ...]
Command line only options:
-no-config Do not load configuration, use default values.
-v,-version Print the version number and exit.
-dmenu Start in dmenu mode.
-display [string] X server to contact.
${DISPLAY}
-h,-help This help message.
@mskorzhinskiy
mskorzhinskiy / org-new-navigation.el
Created April 22, 2020 12:33
Customized navigation for org-mode
;; New navigation/edition
(defmacro org-user/save-state (&rest body)
"Helper for executing BODY with macroses."
(declare (debug (body)))
`(save-excursion
(save-restriction
(org-save-outline-visibility nil
,@body))))
@mskorzhinskiy
mskorzhinskiy / emacs-org-attach-file.sh
Created June 28, 2020 21:43
Helper to attach files to org-mode
#!/bin/bash
# Author: Mikhail Skorzhinskii <mskorzhinskiy@eml.cc>
#
# Description: Create a new file for org-mode and (may-be) try to attach it to
# the org-mode
choice=`kdialog --radiolist Type: Drawing Drawing on Screenshot Screenshot off Voice Voice off`
file_name=`uuidgen`
@mskorzhinskiy
mskorzhinskiy / ricing.el
Created September 1, 2020 09:31
Doom emacs org-mode ricing
;; Font
(setq doom-font "Iosevka-9")
;; Hide signs like "~" or "_" or "*"
(setq org-hide-emphasis-markers t)
;; Don't align tags
(setq org-tags-column 0)
;; Increase indenation in org-indent
@mskorzhinskiy
mskorzhinskiy / org-ql-rasmi.el
Created December 18, 2020 09:15
Current configuration for personal org queries
(setq
org-ql-views
'(("stuck" lambda nil
(interactive)
(org-ql-search
(org-agenda-files)
'(and (tags "story")
(not (tags "ignore"))
(not (done)) ;; Finished stories should be excluded
(not (descendants (todo "NEXT"))) ;; If there are already