Skip to content

Instantly share code, notes, and snippets.

View superherointj's full-sized avatar
💫
Human input is error.

superherointj

💫
Human input is error.
View GitHub Profile
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
var evs = require('event-stream');
var uglify = require('gulp-uglify');
var watchify = require('watchify');
var browserSync = require('browser-sync').create();
//var reload = browserSync.reload;
// Hello. I'm learning. Thank you for sharing your insights.
var sUtil = require('sUtils.js');
var obj = {
a:[1,2],
b:[3,4],
}
// (1) Check if is array. If it is array, then apply function to it's value.
/*
Thank you for helping.
I am trying to figure out how RxJS works.
I'm really new to this and haven't made 'the leap' yet.
I appreciate your feedback.
Question:
Is it good idea to use RxJS to replace 'callbacks' in a routine?
I'm after a solution for 'callback hell'.
And I've read somewhere RxJS is a replacement for Promises.
@superherointj
superherointj / rxwindow.js
Created June 8, 2016 20:03
Take 2 items per time and execute a list of synchronous operation. 2 * 6 * 4
const Rx = require('rxjs');
// This function is expected to be executed serially. One item per time. So it should take 6 seconds.
function processItem(item){
let queueTransformed = [
Rx.Observable.timer(1000).do(x=>console.log('1',item)).map(x=>'1'+item),
Rx.Observable.timer(1000).do(x=>console.log('2',item)).map(x=>'2'+item),
Rx.Observable.timer(1000).do(x=>console.log('3',item)).map(x=>'3'+item),
Rx.Observable.timer(1000).do(x=>console.log('4',item)).map(x=>'4'+item),
Rx.Observable.timer(1000).do(x=>console.log('5',item)).map(x=>'5'+item),
@superherointj
superherointj / after.logs
Created October 14, 2017 10:48
reason-cli on WSL & bs-platform
intj@SuperDesktopINTJ:~$ npm install -g bs-platform
/usr/bin/bsrefmt -> /usr/lib/node_modules/bs-platform/bin/bsrefmt
/usr/bin/bsc -> /usr/lib/node_modules/bs-platform/bin/bsc
/usr/bin/bsb -> /usr/lib/node_modules/bs-platform/bin/bsb
> [email protected] postinstall /usr/lib/node_modules/bs-platform
> node scripts/install.js
Working dir /usr/lib/node_modules/bs-platform
ninja binary is copied from pre-distribution
@superherointj
superherointj / merlin output on windows
Created December 10, 2017 14:40
merlin output on windows
sh-4.4$ ./configure --prefix `pwd`/inst
Merlin configuration
--------------------
Found findlib GOOD
Found yojson GOOD
SUPERHEROINTJ => Executes 0
exit
SUPERHEROINTJ => DOES NOT execute => 1
SUPERHEROINTJ => DOES NOT execute => 3
SUPERHEROINTJ => DOES NOT execute => END
@superherointj
superherointj / app.js
Created December 13, 2017 16:10
App for testing Merlin protocol
// The goal here is to print Merlin version 3 times. To test sync/async support.
const { spawn } = require("child_process");
const mp = spawn("ocamlmerlin");
let i = 0;
mp.stdin.write('["protocol","version"]');
@superherointj
superherointj / error1.log
Created October 10, 2019 19:58
aws-lambda-ocaml-runtime error
Sending build context to Docker daemon 3.532MB
Step 1/26 : FROM node:alpine as build
---> 4c6406de22fd
Step 2/26 : ENV TERM=dumb LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib
---> Using cache
---> d146b907a5a5
Step 3/26 : RUN mkdir /esy
---> Using cache
---> 83fefa197966
@superherointj
superherointj / ldd_ponyup.log
Created December 20, 2019 12:01
ldd_ponyup.log
ldd ponyup
linux-vdso.so.1 (0x00007ffdc0d4a000)
librt.so.1 => /usr/lib/librt.so.1 (0x00007f44581c1000)
libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x00007f4458131000)
libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x00007f4457e60000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f4457e3e000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f4457e39000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f4457cf1000)
libatomic.so.1 => /usr/lib/libatomic.so.1 (0x00007f4457ce7000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f4457ccd000)
@superherointj
superherointj / Dockerfile.building
Created December 22, 2019 15:15
Tracking pony-stable issue - Upstream or Packaging?
FROM superherointj/archlinux-base as archlinux-pkgbuild-base
# ArchLinux PKGBUILD requires
RUN pacman -S --noconfirm fakeroot binutils
#Pick EITHER:
# (1) base-devel
# (2) fakeroot binutils
RUN mkdir /app
WORKDIR /app
# makepkg requires non-root user
RUN useradd notroot