Skip to content

Instantly share code, notes, and snippets.

View dmitryuk's full-sized avatar
🗿
#PHP #NodeJs Full-stack Developer

Alexander Dmitryuk dmitryuk

🗿
#PHP #NodeJs Full-stack Developer
View GitHub Profile
@dmitryuk
dmitryuk / winston-logger.ts
Created June 12, 2020 12:18
Use native functions console.log, console.error, console.warn, console.info, console.debug with Winston nodejs on Typescript
const logger = createLogger({
transports: [
new transports.Console({ level: 'silly' }),
],
});
console.log = function(){
logger.info.apply(logger, arguments as unknown as [object]);
};
console.info = function(){
@dmitryuk
dmitryuk / jsonb_diff_recursive.sql
Last active September 27, 2021 04:04
Postgres JSONB diff recursive
CREATE OR REPLACE FUNCTION jsonb_diff_val(val1 JSONB, val2 JSONB) RETURNS JSONB AS $$
DECLARE
result JSONB;
difference jsonb;
v RECORD;
BEGIN
result = val1;
FOR v IN SELECT * FROM jsonb_each(val2) LOOP
IF result -> v.key is not null
THEN
192.168.31.74 robocashph.local.dev
@dmitryuk
dmitryuk / JIRA Monospace hotkey Tampermonkey
Last active December 17, 2021 04:50
Tamper monkey script to add hotkey to add Monospace with Ctrl+m
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://jira.*
// @grant none
// ==/UserScript==