Skip to content

Instantly share code, notes, and snippets.

View stelf's full-sized avatar
🦌
focusing 🦊

Gheorghi stelf

🦌
focusing 🦊
View GitHub Profile
function radix(arr) {
let change = false;
let mask = 1
let res = new Array(arr.length)
do {
mask = mask * 10
const bucket = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
@stelf
stelf / express-rss-sax-stream.js
Last active November 14, 2017 22:43
quick demo of how to mix objectMode with String streams and pipe to web
// rss stream reader with nodejs and express solution by stelf
const saxStream = require('sax-stream')
const fs = require('fs')
const http = require('http')
const express = require('express')
const { Transform } = require('stream')
const app = express();
const rssloc = 'http://abcnews.go.com/abcnews/topstories'
@stelf
stelf / proxyftw.js
Last active October 14, 2025 20:11
using ES6 proxies and async/await to dynamically, yet almost transparently connect to some remote data provider
let providerHandler = {
get: async(target, name) => {
console.log('load someting from remote...')
return new Promise( (res, rej) => {
setTimeout(() => res(42), 4200)
})
},
set: function (obj, prop, value) {
return new Promise((res, rej) => {
@stelf
stelf / -
Created November 17, 2017 15:42
# decode-dimms version 6231 (2014-02-20 10:54:34 +0100)
Memory Serial Presence Detect Decoder
By Philip Edelbrock, Christian Zuckschwerdt, Burkart Lingner,
Jean Delvare, Trent Piepho and others
Decoding EEPROM: /sys/bus/i2c/drivers/eeprom/9-0050
Guessing DIMM is in bank 1
<import revision="$LastChangedRevision: 11454 $" xmlns:xi="http://www.w3.org/2001/XInclude">
<most module_alias="m" use_prefix="true">
<objectdefs>
<protocol_return parent_objectdef="most.protocol_stock">
<total mode="delete"/>
</protocol_return>
@stelf
stelf / bad compiled VSQL
Last active December 3, 2017 20:07
bad VSQL result
error:Error on creating prepared statement: SELECT a2_RF0."id" AS PVA_1
FROM VISIONR.pv_m_prt AS o0
LEFT JOIN VISIONR.pv_m_art AS a1 ON (o0."article" = a1.id) AND ( ( ( ( ( ( ( ( a1."session_id" IS NULL OR a1."session_id" = 121484289 ) ) AND a1."is_archived" = 0 ) AND a1."id" <> 0 ) ) AND a1."objectdef" IN ( 3 , 6656 ) ) ) )
LEFT JOIN VISIONR.pv_m_ope AS a2 ON (a1.id = a2."article") AND ( ( ( ( ( ( ( ( a2."session_id" IS NULL OR a2."session_id" = 121484289 ) ) AND a2."is_archived" = 0 ) AND a2."id" <> 0 ) ) AND a2."objectdef" IN ( 3 , 5642 , 5644 , 5645 , 14336 , 14337 ) ) ) )
LEFT JOIN VISIONR.pv_m_opg AS a3 ON (a2."opg" = a3.id) AND ( ( ( ( ( ( ( ( a3."session_id" IS NULL OR a3."session_id" = 121484289 ) ) AND a3."is_archived" = 0 ) AND a3."id" <> 0 ) ) AND a3."objectdef" IN ( 3 , 5643 ) ) ) )
LEFT JOIN VISIONR.pv_m_ope AS a5 ON (a3.id = a5."opg") AND ( ( ( ( ( ( ( ( a5."session_id" IS NULL OR a5."session_id" = 121484289 ) ) AND a5."is_archived" = 0 ) AND
[core|vscr| all] Checking for mask most_app license group=administrators
[core|vscr| all] License manager : already contains slot administrators for session : 122323463
[core|cntx| all] Unable to do fast lookup by CODE for core.object_calculation_script
[core|vscr| all] most.protocol_sale.auto_assign_stock:: process [1] sale instances.
[core|vscr| all] most.protocol_sale.auto_assign_stock: selected date: 08.12.2017
[core|vscr| all] auto_assign_stock: going to work with 1 stocks.
[core|vscr| all] [190977]
[core|vscr| all] auto_assign_stock: 1 protocol objects selected for processing
[core|vscr| all] auto_assign_stock: sale PRO000190977 has quantity > 0
@stelf
stelf / non-proxy.js
Created March 26, 2018 17:07
nodejs/express http proxy mix of websocket and http splitter
var port = 3333;
var proxy = require('http-proxy-middleware');
var express = require('express');
var app = express();
var server = require('http').Server(app);
server.listen(port, () => {
@stelf
stelf / tmux-web2print.sh
Created April 6, 2018 13:17
dev tmux setup
#!/bin/sh
WORKROOT=/media/stelf/work2
tmux new-session -d -c $WORKROOT/web2print -n pechatar -s pechatar
tmux split-window -d -v -t pechatar -c $WORKROOT/visionr2018/visionr-dev
tmux send-keys -t pechatar "vrs run" Enter
tmux send-keys -t pechatar.1 "npm start" Enter
@stelf
stelf / dates.numerology.js
Created December 17, 2018 10:08
find dates with 11/22/33 vibration
for (let y = 2000; y <= 2099; y++ ) {
let [ y11, y22, y33 ] = [0,0,0];
for (let m = 1; m <= 12; m++ ) {
for (let d = 1; d < 31; d++ ) {
let yx = parseInt(y / 1000) + parseInt((y % 100) / 10 ) + y % 10;
if (yx != 11 && yx != 22 && yx != 33 ) {
while (yx >= 10)
yx = parseInt(yx / 10) + yx % 10;