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

@romelgomez
romelgomez / array_of_arrays.sql
Created April 3, 2023 20:18 — forked from AnjaneyuluBatta505/array_of_arrays.sql
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]]))
@romelgomez
romelgomez / fix-missing-libcrypto-osx.md
Created March 10, 2023 21:03 — forked from aklap/fix-missing-libcrypto-osx.md
Resolving missing link to libcrypto/openssl on OSX
import { InfoCircleOutlined } from '@ant-design/icons';
import { Button, Form, Input, Radio, Card } from 'antd';
import { useState } from 'react';
type RequiredMark = boolean | 'optional';
export const OptionalForm = () => {
const [form] = Form.useForm();
const [requiredMark, setRequiredMarkType] = useState<boolean | 'optional'>(
@romelgomez
romelgomez / index.tsx
Created February 23, 2023 14:36
ant form-methods-form
import { Form, Input, Button, Select, Card } from 'antd';
const { Option } = Select;
const tailLayout = {
wrapperCol: { offset: 8, span: 16 },
};
export const FormMethodsForm = () => {
const onFinish = (values: any) => {
@romelgomez
romelgomez / index.tsx
Created February 23, 2023 14:33
ant basic usage form
import { useState } from 'react';
import { Form, Input, Button, Checkbox, Card } from 'antd';
export const BasicUsageForm = () => {
const [date, setDate] = useState<string | undefined>(undefined);
const onSave = () => {
console.log(
JSON.stringify({
date,
@romelgomez
romelgomez / nodereinstall.sh
Created October 26, 2021 13:04 — forked from brock/nodereinstall.sh
Complete Node Reinstall. I've moved this to a repo at http://git.io/node-reinstall
#!/bin/bash
# node-reinstall
# credit: http://stackoverflow.com/a/11178106/2083544
## program version
VERSION="0.0.13"
## path prefix
PREFIX="${PREFIX:-/usr/local}"
@romelgomez
romelgomez / index.js
Created September 27, 2021 14:28 — forked from kosich/index.js
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

Libraries and Tools for React

Components and Component Libraries

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.

Component libraries and Design Systems

Brands (official design systems by various companies and products)

// Add a 401 response interceptor
window.axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (401 === error.response.status) {
swal({
title: "Session Expired",
text: "Your session has expired. Would you like to be redirected to the login page?",
type: "warning",
showCancelButton: true,