Skip to content

Instantly share code, notes, and snippets.

View yanmhlv's full-sized avatar

Ian Mikhailov yanmhlv

View GitHub Profile
@yanmhlv
yanmhlv / vimrc
Last active June 1, 2016 16:31
vimrc config
execute pathogen#infect()
syntax on
filetype plugin indent on
set cin
set ai
colorscheme darkblue
set tabstop=4
set shiftwidth=4
set softtabstop=4
@yanmhlv
yanmhlv / parse_options.rb
Created April 3, 2014 13:15
парсинг коммандной строки
require 'optparse'
options = {}
optparse = OptionParser.new do |opts|
options[:verbose] = false
opts.banner = "Usage: #{$0} --option=value"
opts.on('-v', '--verbose') {options[:verbose] = true}
opts.on('-h', '--help') do
puts "Help message"
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of btsync.
@yanmhlv
yanmhlv / commands.sh
Created July 11, 2014 06:58
полезные команды
rsync -av -e ssh [email protected]:~/logs/* ./logs/ # копирование с помощью rsync
@yanmhlv
yanmhlv / Gemfile
Last active August 29, 2015 14:11
rails_admin + paperclip
# Gemfile
gem 'rails_admin'
gem 'paperclip'
@yanmhlv
yanmhlv / gitcontig
Last active February 1, 2016 16:05
[user]
name = Yan Mihailov
email = [email protected]
[push]
default = current
[color]
branch = auto
diff = auto
interactive = auto
status = auto
@yanmhlv
yanmhlv / books.txt
Created February 1, 2015 19:47
Книги по IT, взято с /pr
=Algorithms
+ Дискретная математика для программистов Г. Хаггард
+ Concrete Mathematics: A Foundation for Computer Science Ronald L. Graham
+ Алгоритмы. Построение и анализ Томас Кормен
+ Искусство программирования. Том 1. Основные алгоритмы Дональд Кнут
+ The Algorithm Design Manual Steven S Skiena
+ Introduction to Distributed Algorithms Gerard Tel
+ Clever Algorithms: Nature-Inspired Programming Recipes Jason Brownlee
package main
import "fmt"
func main(){
a := 3
if a == 3 {
fmt.Println("1. if-else, a == 3")
} else {
fmt.Println("1. if-else, a != 3")
import timeit
time_python = timeit.timeit("""
from itertools import groupby
from random import randint
import pandas as pd
accruals = [
{'account': i, 'value': i * randint(0, 20), 'foo': randint(0, 10)}
for i in range(5000)
package main
import "log"
func groupBy(vars []int) map[int][]int {
result := make(map[int][]int)
for _, value := range vars {
result[value] = append(result[value], value)
}