Skip to content

Instantly share code, notes, and snippets.

View myzone's full-sized avatar

Vyacheslav Goldenshteyn myzone

View GitHub Profile
@myzone
myzone / behavior.rs
Last active March 11, 2016 00:07
Behavior
mod behavior {
pub trait Behavior {
type T;
type S;
type R: IntoIterator<Item=Self::S>;
fn apply(&self, &Self::T, &Self::S) -> Self::T;
fn react(&self, &Self::T, &Self::S) -> Self::R;
}
@myzone
myzone / code.es6
Last active February 23, 2016 18:10
const applier = (rules, reactions) => {
const apply = (state, events) => {
return R.reduce((state, event) => {
const reaction = reactions(state, event);
const next = rules(state, event);
return apply(next, reaction);
}, state, events);
};
@myzone
myzone / Lang comparison.kt
Last active February 20, 2016 23:55
Lang comparison
ECMA Script 6:
const applier = (rules, reactions) => {
const apply = (state, events) => {
return R.reduce((state, event) => {
const reaction = reactions(state, event);
const next = rules(state, event);
return apply(next, reaction);
}, state, events);
@myzone
myzone / so-cool
Last active August 29, 2015 14:17
diff failure
<tag>
<inner_tag>
<awsome target="me"/>
</inner_tag>
<inner_tag>
<awsome target="smo1"/>
<awsome target="smo2"/>
</inner_tag>
@myzone
myzone / myfile.cpp
Last active August 29, 2015 14:14 — forked from anonymous/myfile.cpp
call __main
movl $1, -4(%rbp)
jmp .L2
.L3:
sall -4(%rbp)
movl -4(%rbp), %eax
movl %eax, %edx
movq .refptr._ZSt4cout(%rip), %rcx
call _ZNSolsEi
leaq .LC0(%rip), %rdx
#ifndef _CPLUSPLUS_H
#define _CPLUSPLUS_H
/*
This is applicable if using virtual inheritance.
*/
__extension__ typedef int __guard __attribute__((mode (__DI__)));
extern "C" int __cxa_guard_acquire(__guard *);
extern "C" void __cxa_guard_release (__guard *);
@myzone
myzone / bullshit
Last active January 1, 2016 02:49
rear tyre is tired.
but front is ok.
internet connection is wired.
and it makes our own day.
the time will stuck in traffic.
once our connections go down.
you just can be provided by graphic.
but in lie legenda will drown.
@myzone
myzone / FibTest.java
Created December 3, 2013 12:23
Declarative java :)
package com.myzone.nopebook;
import java.util.function.Function;
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
/**
* Created by myzone on 12/3/13.
*/
@myzone
myzone / _stdout
Last active December 29, 2015 14:49
JVM Crash
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0xb6ec66da, pid=16590, tid=468130624
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b116) (build 1.8.0-ea-b116)
# Java VM: Java HotSpot(TM) Server VM (25.0-b58 mixed mode linux-x86 )
# Problematic frame:
# V [libjvm.so+0x68c6da] Method::bci_from(unsigned char*) const+0xa
#
javascript: $(".nav, #queue_title").css("display", "none"); // hide navigation-bar
javascript: $(".nav, #queue_title").css("display", "block"); // show navigation-bar