Skip to content

Instantly share code, notes, and snippets.

View hyzhak's full-sized avatar
🤔
feel creative

Ievgenii Krevenets hyzhak

🤔
feel creative
View GitHub Profile
@hyzhak
hyzhak / my-form.ts
Last active December 14, 2016 13:54
enable/disable group of elements on input[radio] selected for angular 2 with reactive forms (ReactiveFormsModule)
//angular 2 (TypeScript, ReactiveFormsModule)
export class MyForm {
form: FormGroup;
constructor(fb: FormBuilder) {
this.form = fb.group({
radioInput: '',
group1: fb.group({
ctr0: '',
ctr1: '',
@hyzhak
hyzhak / async_stories.py
Last active September 3, 2016 23:02
architecture of stories - stateless and async
"""
v0.1.0
Bot asks user about destionation of space travelling.
- stateful story, it stores context of story (current question) in python interpreter
"""
@story.once('lets go!')
async def async_story(message):
dest = await ask_location(message['user'], text='Where do you go?')
store_destination(dest['location'])
@hyzhak
hyzhak / sysbench.fileio.docker.log
Last active January 31, 2016 22:08
sysbench file io test inside of docker
sysbench 0.4.12: multi-threaded system evaluation benchmark
128 files, 65536Kb each, 8192Mb total
Creating files for the test...
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Initializing random number generator from timer.
@hyzhak
hyzhak / sysbench.fileio.rpi2.log
Created January 31, 2016 22:07
sysbench file io test inside of pure rpi2
sysbench 0.4.12: multi-threaded system evaluation benchmark
128 files, 65536Kb each, 8192Mb total
Creating files for the test...
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Initializing random number generator from timer.
@hyzhak
hyzhak / sysbench.cpu.rpi2.log
Created January 30, 2016 21:52
sysbench cpu test inside of rpi2
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
@hyzhak
hyzhak / sysbench.cpu.docker.log
Created January 30, 2016 21:48
sysbench cpu test inside of docker
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Doing CPU performance benchmark
Threads started!
Done.
@hyzhak
hyzhak / clear.js
Created June 10, 2013 10:32
Need to clear some cached objects before recreate WebGLRenderer of Pixi.js. To avoid of binding on previous 3D context.
//clear some cached objects in Pixi.js
PIXI._batchs.length = 0;
PIXI.TextureCache = {};
PIXI.BaseTextureCache = {};
@hyzhak
hyzhak / log-leapmotion-websocket.js
Created May 26, 2013 18:26
Short js code to log leapmotion data thought websocket. From article [Leap Motion / Getting started with raw data](http://pressanykeytocreate.blogspot.com/2013/05/leap-motion-getting-started-with-raw.html)
var ws = new WebSocket("ws://localhost:6437/");
ws.onmessage = function(event) {
console.log(event.data);
};
@hyzhak
hyzhak / infinite-surface-with-parallax.js
Last active December 17, 2015 06:59
Example of implementation of parallax effect on darlingjs game engine (http://darlingjs.github.io)
(function(darlingjs, darlingutil) {
'use strict';
var width = 640,
height = 480;
//Create game world
var world = darlingjs.w('theCyclicWorld', [
'ngFlatland',
'ngCyclic',
'ng3D',
@hyzhak
hyzhak / parallax.js
Last active December 17, 2015 06:58
Implement parallax effect by project 3D to 2D
/**
* Component of position in 3D environment
*/
m.$c('ng3D', {
x: 0.0,
y: 0.0,
z: 0.0
});
/**