Skip to content

Instantly share code, notes, and snippets.

View yoursdearboy's full-sized avatar
:shipit:
Ship it!

Kirill Voronin yoursdearboy

:shipit:
Ship it!
View GitHub Profile
@yoursdearboy
yoursdearboy / make-bibliography
Last active December 8, 2016 14:44
Make markdown bibliography from bib file
#!/bin/sh
# Converts bib file to markdown bibliography text.
# Treats markdown headings in bib file as chapters.
# You can put any markdown there and
# actually use references to entries in the chapter.
# (You can't, if you want to use it with biblatex).
if [ -z "$1" ]; then
echo "Usage: $0 bib-file [csl-file]"
exit 1;
@yoursdearboy
yoursdearboy / parse-icf.rb
Created December 5, 2016 10:57
Class and script to make json/csv from ICF classificator
#!/usr/bin/env ruby
# As source you need HTML file from http://apps.who.int/classifications/icfbrowser/Default.aspx
# with unfolded tree.
# It uses Ajax to fetch nested entries, so unfold each manually or you can use JS console to autoclick.
require 'optparse'
require 'nokogiri'
require 'json'
require 'csv'
class ICFEntry < Struct.new(:id, :code, :title, :children)
@yoursdearboy
yoursdearboy / copytocb.groovy
Created December 26, 2016 12:58
OmegaT script to copy current entry to clipboard
import org.omegat.core.Core
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import java.awt.datatransfer.Transferable
def clipboard = Toolkit.getDefaultToolkit().getSystemClipboard()
def text = Core.getEditor().getCurrentEntry().srcText
clipboard.setContents(new StringSelection(text), null)
@yoursdearboy
yoursdearboy / my-ggsurv.R
Created January 6, 2017 20:46
Good looking survival curves using ggplot2
# I recommend to use [GGaly::ggsurv](http://ggobi.github.io/ggally).
# Can't remember why, but it didn't work for my purpose, so I wrote this.
#
# - ggsurv.data - produces data.frame to use with ggplot
# * survfit
# * optional subset rule
#
# - ggsurv.plot - plots survfit or data.frame.
# * survfit / data.frame
# * ms - if data.frame is passed, set to true/false if model is multistate
@yoursdearboy
yoursdearboy / rails-console-remote.el
Created February 15, 2017 12:50
Remote Rails console over SSH
;;; rails-console-remote.el --- remote rails console over ssh
;; Copyright (C) 2016 Kirill Voronin <[email protected]>
;; Author: Kirill Voronin <[email protected]>
;; Keywords: rails
;; Version: 0.0.1
(defun rails-console-remote (&optional host &optional path &optional env &optional user-cmd)
"Call `run-ruby'."
@yoursdearboy
yoursdearboy / Dockerfile
Last active April 17, 2018 08:55
Socks proxy за 5 минут - регистрируем сервер и запускаем setup.sh на машине с Ubuntu https://m.do.co/c/2677ff7955bf ($10 в подарок)
FROM wernight/dante
RUN sed -i '177s/#socksmethod/socksmethod/' /etc/sockd.conf
EXPOSE 1080
ENTRYPOINT ["dumb-init"]
CMD ["sockd"]
@yoursdearboy
yoursdearboy / Multitran.alfredworkflow
Last active December 30, 2022 08:53
Alfred workflow to lookup multitran.ru
@yoursdearboy
yoursdearboy / .gitconfig
Created August 13, 2019 11:01
Compare XLSX files using [daff](http://paulfitz.github.io/daff/)
[diff "xlsx"]
command = xlsx2daff diff
[diff "csv"]
command = daff diff --git
@yoursdearboy
yoursdearboy / ediff
Created October 22, 2019 11:30
Emacs Ediff using emacsclient with exit code on exit
#!/bin/sh
# Author: Kirill Voronin <[email protected]>
# Ediff with exit code
# Opens ediff in existing Emacs window using emacsclient
# and returns exit code when *ediff-diff* buffer closed
get_buffer() {
emacsclient --eval "(get-buffer \"$1\")"
}
@yoursdearboy
yoursdearboy / export.js
Created June 26, 2020 11:13
Automate Firefox Lockwise export
/* Firefox Lockwise password copy buttons.
1. Copy code below to the console.
2. Select each login in the left menu, click Copy password button.
3. Click Copy all passwords button.
4. ???
5. PROFIT
*/
const TIMEOUT = 300;
var passwords = [];