Skip to content

Instantly share code, notes, and snippets.

View yantonov's full-sized avatar

Yury Antonov yantonov

  • The Milky Way galaxy
View GitHub Profile
@yantonov
yantonov / seq_test.clj
Last active December 26, 2015 14:07
How to dechunk(unchunk) sequence in clojure. Chunked and dechunked sequence realization count example.
(ns seq-test)
(ns seq-test
(:require [clojure.test :as test]))
;; clarification 1
;; be carefull this functions guarantees one-by-one fetching for client of the dechunk function,
;; but NOT guarantees that source seq will not be evaluated forward by chunks
;; given tests demonstrates it
@yantonov
yantonov / catalina.sh
Created July 7, 2013 05:43
tomcat start/stop script
#!/bin/bash
# Tomcat start/stop script
export JAVA_HOME=~/Development/bin/jdk
export CATALINA_HOME=~/Development/bin/tomcat
export JAVA_OPTS="-Dorg.apache.catalina.session.StandardSession.ACTIVITY_CHECK=true -Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=true"
CONTEXT_CONF_DIR=`dirname $0`/app-context
function out_action() {
echo "--------------------------------"
@yantonov
yantonov / bitrev.clj
Last active December 10, 2015 01:34
Reverse binary representation of 8 (16) bit numbers
(ns bitrev
(use clojure.test))
;; http://dolzhenko.blogspot.ru/2012/12/blog-post.html
;; reverse binary representation of 8 bit number
;; reverse binary representation of 16 bit number
(defn reverse-8bit
"reverse 8 bit number"
[n]
@yantonov
yantonov / gist:3634231
Last active November 18, 2015 14:14
LR-task
(ns lr-task.ad-hoc
(:use clojure.test))
;;; http://dolzhenko.blogspot.com/2012/09/blog-post.html
;; Любая последовательность операторов длины в точности n позволяет
;; получить все числа [-2^n+1 2^n]
;; Индукция по n
@yantonov
yantonov / gtk.css
Created June 20, 2014 00:33
Highlight current tab for ubuntu terminal (~/.config/gtk-3.0/gtk.css)
TerminalWindow .notebook {
padding: 0;
border-width: 0;
}
TerminalWindow,
TerminalWindow.background {
background-image: none;
background-color: #6e6e6e;
color: #000000;
@yantonov
yantonov / pidbyname.sh
Last active October 14, 2015 02:17
Get process id by name in linux.
##/bin/bash
# find process id by name
# returns pid
if [ $# -lt 1 ]; then
echo "Usage: pidbyname name"
exit 0
else
EXEC_NAME=$1
@yantonov
yantonov / xstartup
Created September 30, 2012 17:24
vnc4server config file for ubuntu 11.10, 12.04
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
@yantonov
yantonov / hg-tip-list.sh
Created September 7, 2012 12:38
Hg dir lister
#!/bin/bash
# Script show list of mercurial repositories with latest revision id
# first parameter - directory which contains multiple mercurial repositories
DEFAULT_MERCURIAL_REPO_DIR=`pwd`
LINE_SEPARATOR="-----"
# output line separator
function output_line_separator() {
@yantonov
yantonov / ocr-multipage-pdf.sh
Created March 22, 2012 05:27
OCR multipage pdf file
#!/bin/bash
#
# Optical character recognition for multipage pdf file
#
#
# Prerequisites:
# pdftk, cuneiform, imagemagick
#
@yantonov
yantonov / install-rabbitmq.sh
Created September 27, 2014 08:43
install latest rabbitmq 3.3.5
#!/bin/bash
wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.3.5/rabbitmq-server_3.3.5-1_all.deb
dpkg -i rabbitmq-server_3.3.5-1_all.deb
rm rabbitmq-server_3.3.5-1_all.deb