Skip to content

Instantly share code, notes, and snippets.

View ilyavf's full-sized avatar

Ilya ilyavf

View GitHub Profile
@ilyavf
ilyavf / machine.js
Last active June 25, 2021 14:39
Generated by XState Viz: https://xstate.js.org/viz
// import { createMachine, assign, interpret } from 'xstate';
// const Machine = createMachine
const machine = Machine({
id: 'lnd',
initial: 'idle',
context: {
isNewWallet: true,
fundingAddress: null,
balance: 0,
@ilyavf
ilyavf / machine.js
Created May 22, 2021 03:46
Generated by XState Viz: https://xstate.js.org/viz
// import { createMachine, assign, interpret } from 'xstate';
// const Machine = createMachine
const genSeed = () => {
return new Promise((resolve, reject) => {
resolve([1,2,3,4,5])
})
}
const initWallet = () => {
return new Promise((resolve, reject) => {
@ilyavf
ilyavf / 0_travis.yml
Last active October 23, 2017 15:56
testee ff error
language: node_js
node_js: 7.3
cache: yarn
addons:
firefox: "latest-esr"
# Install D-Bus here
apt:
packages:
- dbus-x11
before_install:
@ilyavf
ilyavf / Travis log file 2
Created October 2, 2017 16:42
Client failed to connect to the D-BUS daemon
This file has been truncated, but you can view the full file.
travis_fold:start:worker_info
Worker information
hostname: d473378f-19f7-4bca-8a03-7cb64bdde56b@1.production-1-worker-com-c-2-gce
version: v3.0.2 https://github.com/travis-ci/worker/tree/f1c05caed79c66a9103f12a22e8a45ec66dbca64
instance: testing-gce-f79c2015-05b8-4f05-92ae-330425d36569:travis-ci-garnet-trusty-1503972833 (via amqp)
startup: 21.275902191s
travis_fold:end:worker_info
travis_fold:start:system_info
Build system information
Build language: node_js
@ilyavf
ilyavf / 0-travis-2.yml
Last active October 2, 2017 17:36
Client failed to connect to the D-BUS daemon
sudo: required
language: node_js
node_js: 7.3
addons:
firefox: "51.0"
cache: yarn
before_install:
- "export DISPLAY=:99.0"
- "export DEBUG=testee:*"
@ilyavf
ilyavf / 0_list.md
Last active September 17, 2024 02:05
Инструкции по github для начинающих
  • git help встроенная помощь git со списком всех доступных git-команд. Выход из режима просмотра - клавиша q.
  • git help <command> помощь по отдельным командам, например: git help status
  • git clone <link to you repo> копирование удаленного репозитория на локальный диск (в текущей директории будет создана папка по названию проекта
  • git status список файлов с текущими изменениями
  • git diff просмотр всез текущих изменений
  • git diff my-file.html просмотр изменений конкретного файла
  • git commit -am "my comment about changes"
  • git push отгрузка коммитов на удаленный репозиторий
  • git log -5 просмотр последних 5 коммитов
  • git log -1 -p просмотр изменений последнего коммита
@ilyavf
ilyavf / 0-decoded-transaction.json
Created July 19, 2017 19:30
Blockchain transaction with OP_RETURN
{
"result": {
"txid": "62fe533dc5a506716affa362ca5cb7bba5232150ce5c676c56d6be6769022c52",
"hash": "62fe533dc5a506716affa362ca5cb7bba5232150ce5c676c56d6be6769022c52",
"size": 264,
"vsize": 264,
"version": 1,
"locktime": 0,
"vin": [
{
@ilyavf
ilyavf / 0_readme.md
Last active December 6, 2016 18:53
steal is trying to load package.json from a wrong location

Install project

$ git clone https://github.com/donejs/bitcentive && cd bitcentive
$ git checkout fail-loading
$ npm install
$ npm start

Note: the app is served from /public with its own /public/node_modules.

Goal

Show how to test RESTful front-end models that use socket.io as its transport.

Plan

  1. Warm up: build a small app with realtime communication using socket.io (maybe a chat).
  2. Refactor: rebuild model layer to be RESTful via sockets.
  3. Ask how should we test this, and talk about options.
  4. Show what can-socket-fixture is for, and try to test with it.
@ilyavf
ilyavf / README.md
Last active November 4, 2016 19:54
The need to delay socket.io connections for testing

TL;DR

To test a module that uses socket.io we need to intercept a socket.io connection and mock a server responses. If a module tries to establish a socket.io connection immediately on a module evaluation then it won't reach the mocked socket.io.

To overcome the problem we either have to delay the evaluation of the modules we test, or delay establishing the socket.io connection.

The steal-socket package addresses the problem using the second option.

Overview