Skip to content

Instantly share code, notes, and snippets.

{
"docker.attachShellCommand.linuxContainer": "/bin/bash",
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 13,
"editor.formatOnSave": false,
"editor.insertSpaces": true,
"editor.rulers": [100],
"editor.tabSize": 2,
"emmet.excludeLanguages": ["markdown"],
@labiak
labiak / swap.sh
Created February 4, 2019 16:11 — forked from kissarat/swap.sh
FILENAME=/tmp/swap-$(date +%s)
dd if=/dev/zero of=${FILENAME} bs=1M count=$1
mkswap ${FILENAME}
chmod 600 ${FILENAME}
swapon ${FILENAME}
As I as I could see in recent years, dive more into JavaScript backend and frontend programming,
JavaScript is a simple hierarchy composition language, so it best feet for metaprogramming.
People don't like JS for dynamic typing and absence control of state and strict validation.
We have flexible type checking instrument with declarative JSON configuration - jsonschema.
Based of this instrument we can build API gateways using Swagger declarations that is extension of jsonschema.
I propose a radically different approach to changing the state of an object and I understand that it require
different way of thinking in way of transactions, not in way in integral algorythms.
Instead of a microservice, I suggest using a simpler notion - an enzyme
@labiak
labiak / strapi.store_core.plugin_content-manager_schema.js
Created December 7, 2018 00:26
plugin_content-manager_schema in store_core of strapi-based project
{
"generalSettings": {
"search": true,
"filters": true,
"bulkActions": true,
"pageEntries": 10
},
"models": {
"plugins": {
"upload": {
// magic = 0x75627265
struct UbreezMessage {
uint32_t magic;
char id[12];
float CO2;
float H;
float P;
float TVOC;
float eCO2;
float t;
{
"sid": "SM29f4f980778e4621b72df75ac82f5000",
"date_created": "Tue, 27 Nov 2018 16:14:39 +0000",
"date_updated": "Tue, 27 Nov 2018 16:14:39 +0000",
"date_sent": null,
"account_sid": "ACc4c268517530bb5fec0b659e3f88c6be",
"to": "+380671541943",
"from": "+19106000514",
"messaging_service_sid": null,
"body": "Hello",
{
"routes": [
{
"method": "GET",
"path": "/users/me",
"handler": "User.me",
"config": {
"policies": [],
"prefix": ""
}
/^0x[\da-f]{40}$/i
const http = require('http');
const {getOptions, pretty} = require('./utilities');
const [{port = 1989, help = false, color = false}] = getOptions();
function report(...args) {
console.log('// ', ...args);
}
if (help) {
@labiak
labiak / postman.js
Last active November 3, 2018 14:55
This is a script for applying changes to base Postman import file. Use node merge-postman.js <source> <target> Where <source> - is a base JSON import file for applying changes And <target> - file with new request to add to <source> file
/**
* This is a script for applying changes to base Postman import file.
* Use
* node merge-postman.js <source> <target>
* Where <source> - is a base JSON import file for applying changes
* And <target> - file with new request to add to <source> file
* @author Taras Labiak <taras.labiak@indeema.com>
* {@link https://indeema.com Indeema}
*/