Skip to content

Instantly share code, notes, and snippets.

View gliush's full-sized avatar

Ivan Glushkov gliush

View GitHub Profile
@gliush
gliush / blog_parser.hs
Created March 5, 2012 19:27
Haskell parsec exampl
--hello
@gliush
gliush / Makefile
Created August 17, 2012 14:13
Knave small task
all:
ghc --make knave.hs
@gliush
gliush / draw_text.py
Created October 22, 2013 07:46
Draw text on the image
#!/usr/bin/env python
@gliush
gliush / nsto2.config.in
Last active August 29, 2015 13:58
riak bench
{mod, max}.
{duration, 5}.
{report_interval,1}.
%concurrent%
{driver, basho_bench_driver_riakc_pb}.
%key_gen%
#!/usr/bin/python
import os
import sys
import re
from collections import defaultdict
variants = {
"concurrent" : ["1000", "2000", "3000", "5000"],
"key_generator" : ["uniform_int, 10000", "uniform_int, 10000000", "pareto_int, 10000", "pareto_int, 10000000"],
@gliush
gliush / matrix.raw
Last active August 29, 2015 14:05
aug fp content
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
011101100111011101010111011101110111011100111011001110111010101110111011101110111001110110011101110101011101110111011101110
010100100001000101010100010000010101010100101001000010001010101000100000101010101001010010000100010101010001000001010101010
010100100111011101110111011100110111011100101001001110111011101110111001101110111001010010011101110111011101110011011101110
010100100100000100010001010100100101000100101001001000001000100010101001001010001001010010010000010001000101010010010100010
011101110111011100010111011100100111011100111011101110111000101110111001001110111001110111011101110001011101110010011101110
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
011101100111011101010111011101110111011100111011001110111010101110111011101110111001110110011101110101011101110111011101110
01010010000100010101010001000001
@gliush
gliush / check_network.sh
Last active January 8, 2022 17:05
check_network
[ -z "$1" ] && echo "no logdir specified" && exit 2
[ -z "$2" ] && echo "no node specified" && exit 2
gen=$1
host=$2
mkdir $gen && cd $gen || exit 2
PERIOD="10mins"
end=`date -d +$PERIOD +%s`
@gliush
gliush / fp_oct.hs
Created October 10, 2014 10:58
fp contest, Oct
main = putStrLn "hello world"
@gliush
gliush / README.md
Last active August 29, 2015 14:11
meck fails while running 'meck:expect'

Here's a test project with 2 files that shows the problem.

You need 2 modules

  • in the first module you should have a eunit test
  • in the second module you should meck any function from the first module

When you run eunit, the meck fails at 'meck:expect' with 'undefined' exception.

How to reproduce:

@gliush
gliush / test.rs
Created March 2, 2016 14:15
How to make rust work?
// Run it with:
// echo -e "John Smith\nData1\nData2" > /tmp/in.txt; rustc test.rs && ./test
// Then change the output command in the loop in main() and try again
use std::io::prelude::*;
use std::fs::File;
use std::io::{BufReader,Stdout,self};
#[derive(Debug)]
pub struct Data<'a>{
name: &'a str,