This file contains 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
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() |
This file contains 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
;; 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 |
This file contains 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
(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") |
This file contains 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
#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); | |
} |
This file contains 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
"""""""""""""""""""""""""""""""""""""""""""""""" | |
" File: .vimrc " | |
" Create Date: Nov 04, 2010 " | |
" Author: Michail Skorzinskiy " | |
" email : rasmikun@gmail.com " | |
" jabber: rasmikun@gmail.com " | |
"""""""""""""""""""""""""""""""""""""""""""""""" | |
This file contains 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
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. |
This file contains 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 | |
# 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` |
This file contains 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
;; Taken from https://github.com/novoid/dot-emacs/blob/master/config.org | |
(defun my-generate-sanitized-alnum-dash-string (str) | |
"Returns a string which contains only a-zA-Z0-9 with single dashes | |
replacing all other characters in-between them. | |
Some parts were copied and adapted from org-hugo-slug | |
from https://github.com/kaushalmodi/ox-hugo (GPLv3)." | |
(let* (;; Remove "<FOO>..</FOO>" HTML tags if present. | |
(str (replace-regexp-in-string "<\\(?1:[a-z]+\\)[^>]*>.*</\\1>" "" str)) | |
;; Remove org-mode links |
This file contains 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/env perl | |
# | |
# This will try to find orphaned attachments in folder ~/org/storage | |
# using first argument to this script as a location where org files | |
# are | |
# | |
# Note, I haven't used this function in a while, unsure if it still works | |
# with most recent org versions... | |
use strict; |
OlderNewer