Skip to content

Instantly share code, notes, and snippets.

View romelgomez's full-sized avatar
:octocat:
https://www.linkedin.com/in/romelgomez/

Romel Gomez romelgomez

:octocat:
https://www.linkedin.com/in/romelgomez/
View GitHub Profile
@romelgomez
romelgomez / README.md
Created October 25, 2023 14:42 — forked from tmilos/README.md
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

// based on Алексей Сердюков's answer at Stackoverflow (https://stackoverflow.com/a/50837219/1143392)
import {
Directive,
Input,
OnDestroy,
OnInit
} from '@angular/core';
import { MediaObserver } from '@angular/flex-layout';
import { MatGridList } from '@angular/material';
@kosich
kosich / index.js
Last active September 27, 2021 14:28
Pausable Observable with buffer
const { rxObserver, palette } = require('api/v0.3');
const { merge, timer, Subject, from, empty } = require('rxjs');
const { filter, startWith, bufferToggle, take, flatMap, zip, distinctUntilChanged, share, skip, map, windowToggle } = require('rxjs/operators');
// stream for coloring
const palette$ = from(palette);
const source$ = timer(0, 10).pipe(
take(10),
// get color for each item
@AnjaneyuluBatta505
AnjaneyuluBatta505 / array_of_arrays.sql
Created November 16, 2018 12:53
merge array of arrays in postgresql with array_agg
--select ARRAY(select distinct unnest(array_agg(category.arr)))
select ARRAY(select distinct unnest(array[array[1,2,3], array[4,2,8]]))
@SagiMedina
SagiMedina / ImageTools.js
Last active March 25, 2024 06:13
Resize and crop images in the Browser with orientation fix using exif
import EXIF from 'exif-js';
const hasBlobConstructor = typeof (Blob) !== 'undefined' && (function checkBlobConstructor() {
try {
return Boolean(new Blob());
} catch (error) {
return false;
}
}());
@Zate
Zate / get_go.sh
Last active February 5, 2024 18:19
Shell script to download and install latest golang
#! /bin/bash
# [get_golang.sh](https://gist.github.com/n8henrie/1043443463a4a511acf98aaa4f8f0f69)
# Download latest Golang release for AMD64
# https://dl.google.com/go/go1.10.linux-amd64.tar.gz
set -euf -o pipefail
# Install pre-reqs
sudo apt-get install python3 git -y
o=$(python3 -c $'import os\nprint(os.get_blocking(0))\nos.set_blocking(0, True)')

Libraries and Tools for React

If you're developing an application based on React it can be helpful if you don't need to develop all the basic UI components yourself. Here you can find a list with various components, component libraries and complete design systems developed with and for React.

As the list got longer and longer I thought it would be better to have a "real" site for it.

👉 Please find the (new) list here: https://react-libs.nilshartmann.net/

##
## How to install mcrypt in php7.2 / php7.3
## Linux / MacOS / OSX
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
#
@innovia
innovia / setup.py
Last active October 23, 2022 13:22
from setuptools import find_packages, setup
from package import Package
setup(
author="Ami Mahloof",
author_email="author@email.com",
packages=find_packages(),
include_package_data=True,
cmdclass={
"package": Package
@muhammadghazali
muhammadghazali / the-correct-approach-to-handle-stripe-timestamp.js
Created March 20, 2017 05:35
Converting the Stripe epoch timestamp to ISO 8601
export function secondsToISOString(seconds) {
const date = new Date(seconds * 1000);
return date.toISOString();
}