Skip to content

Instantly share code, notes, and snippets.

View am-kantox's full-sized avatar
🎩
constantly matching the patterns

Aleksei Matiushkin am-kantox

🎩
constantly matching the patterns
View GitHub Profile
# based on agnoster zsh prompt
# vim:ft=zsh ts=2 sw=2 sts=2
#
# mudasobwa's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
@am-kantox
am-kantox / progress_bar.rb
Last active November 24, 2016 09:45
ProgressBar in ruby (e. g. for console rakes.)
class ProgressBar
RUNNING = %W{👆 👇 👈 👉 👊}.freeze
attr_reader :count, :position
def initialize caption, count, running = RUNNING
@count = count
@caption = " #{caption} "
@running = running.cycle
@position = 0
@am-kantox
am-kantox / RMS_Installer.xml
Last active August 29, 2015 14:26
RMS_Installer.xml template for headless installation
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="db_url">localhost</entry>
<entry key="db_port">3306</entry>
<entry key="server_service_id_overwrite">null</entry>
<entry key="eula_accepted">true</entry>
<entry key="server_port">8080</entry>
<entry key="db_password">*******</entry>
<entry key="mail_password"/>
@am-kantox
am-kantox / rapid-miner-server.sh
Last active September 12, 2016 11:50
init.d service to start/stop/restart RapidMiner Server
#!/bin/sh
RMS=`basename "$0"`
RMS_HOME=/home/ubuntu/Apps/rms
application_start() {
echo -n "Starting RapidMiner Server daemon... "
# to satisfy fcuking RMS, run as a user:
# sudo -u ubuntu $RMS_HOME/bin/standalone.sh 2>&1 > $RMS_HOME/log/$RMS-$(date +"%m-%d-%y").log &
$RMS_HOME/bin/standalone.sh 2>&1 >/var/log/$RMS.log &
export TERM=xterm-256color
# Less Colors for Man Pages
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
export LESS_TERMCAP_me=$'\E[0m' # end mode
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
@am-kantox
am-kantox / sensible-array.rb
Created April 9, 2015 12:46
Sensible Arrays
module Sensible
module Array
class ::Array
alias_method :select_std, :select
def select arg = nil, &cb
preselected = case arg
# no argument ⇒ standard processing
when NilClass then self
# strings are matched as is
when String then select_std do |e|