Skip to content

Instantly share code, notes, and snippets.

View roman01la's full-sized avatar
πŸ‡ΊπŸ‡¦

Roman Liutikov roman01la

πŸ‡ΊπŸ‡¦
View GitHub Profile
@roman01la
roman01la / compose.js
Created April 1, 2015 17:04
compose.js
var compose = function() {
var funcs = arguments;
return function() {
var args = arguments;
for (var i = funcs.length; i --> 0;) {
args = [funcs[i].apply(this, args)];
}
return args[0];
};
};
@roman01la
roman01la / Server.c
Created April 1, 2015 21:40
Server.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winsock2.h>
#pragma comment(lib,"ws2_32.lib")
#define PORTNUM 1738
#define BUFMAX 1024
@roman01la
roman01la / test.js
Created April 8, 2015 12:46
Simple JS testing with zero deps
import MyModule from 'my-module'; // module to test
let test = 'test'; // mock data
let testMsg = 'Should return message: ' + test; // test message
MyModule({ test }, data => {
if (data.res !== test) {
@roman01la
roman01la / sample.hs
Created April 10, 2015 14:48
sample.hs
get :: String -> IO String
get url = getResponseBody =<< simpleHTTP (getRequest url)
get :: String -> IO String
get url = getResponseBody =<< simpleHTTP $ getRequest url
get :: String -> IO String
get url = getResponseBody . simpleHTTP $ getRequest url
@roman01la
roman01la / roman01la.zsh-theme
Created April 16, 2015 08:58
~/.oh-my-zsh/themes/roman01la.zsh-theme
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
local git_branch='$(git_prompt_info)%{$reset_color%}'
local lambda='Ξ»'
PROMPT="${current_dir} ${git_branch}
%B${lambda}%b "
ZSH_THEME_GIT_PROMPT_PREFIX="%{$terminfo[bold]$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
@roman01la
roman01la / apm-packages.txt
Created April 28, 2015 12:02
apm-packages.txt
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
β”œβ”€β”€ [email protected]
@roman01la
roman01la / store-sample.es6
Created April 28, 2015 15:41
store-sample.es6
import d from 'dispatcher';
function cb() {}
// you can make mistake in any of these
// linter will not help here
d.listen('OBJ:EVENT_1', cb);
d.listen('OBJ:EVENT_2', cb);
d.listen('OBJ:EVENT_3', cb);

OS X

  • Install VirtualBox
  • Install Vagrant
  • Install vagrant-vbguest plugin for Vagrant: vagrant plugin install vagrant-vbguest
  • Init VM with SLES 11 SP3 box: vagrant init suse/sles11sp3
  • Run VM: vagrant up
  • SSH into VM: vagrant ssh
  • Install NVM: curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash
  • Create .bash_profile inside of the home dir and paste the following lines:
@roman01la
roman01la / mori-transit.es6
Created May 7, 2015 11:04
mori’s persistent data structure serialization w/ Transit-js
import _ from 'mori';
import t from 'transit-js';
let v = _.vector(1, 'two', 3, 4, 5);
let hm = _.hashMap('key', 'value');
let ms = _.hashMap('key', _.vector(
_.hashMap('key', 'value'),
_.hashMap('key', 'value')
));