Skip to content

Instantly share code, notes, and snippets.

View behagoras's full-sized avatar
🏠
Working from home

David Behar Lombrozo behagoras

🏠
Working from home
View GitHub Profile
@behagoras
behagoras / .eslintrc-no-semi.json
Last active April 21, 2022 14:13
eslint for ts projects
// eslint no semi colons
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"airbnb"
@behagoras
behagoras / App.tsx
Last active May 31, 2021 16:24
Context Implementation
import React, { ReactElement } from 'react'
import Component from './components/Component'
import {CreateUserProvider} from './contexts/CreateUserProvider'
interface Props {
}
export default function App({}: Props): ReactElement {
return (
@behagoras
behagoras / timezones
Created January 28, 2021 20:43 — forked from ykessler/timezones
JSON list of time zones (Based on Olson tz database)
[
{"group":"US (Common)",
"zones":[
{"value":"America/Puerto_Rico","name":"Puerto Rico (Atlantic)"},
{"value":"America/New_York","name":"New York (Eastern)"},
{"value":"America/Chicago","name":"Chicago (Central)"},
{"value":"America/Denver","name":"Denver (Mountain)"},
{"value":"America/Phoenix","name":"Phoenix (MST)"},
{"value":"America/Los_Angeles","name":"Los Angeles (Pacific)"},
{"value":"America/Anchorage","name":"Anchorage (Alaska)"},
@behagoras
behagoras / vim.md
Created January 23, 2021 20:22 — forked from hansrajdas/vim.md
VIM commands

Acronym

  • C-a ==> CTRL-a

Modes in VIM

  • Normal mode(n) When we open mode, the default mode is normal
  • Insert mode(i) When we want to insert some text, we press i, a or A etc to go in insert mode
  • Command mode(c) When we type colon(:) from normal mode, we enters command mode
  • Visual mode(v) Using v or V or C-i

Start VIM

@behagoras
behagoras / useWidthAndHeight.tsx
Created December 24, 2020 18:24
useWidthAndHeight.tsx
import { useRef, useState, useEffect } from 'react';
export default function useWidthAndHeight() {
const containerRef = useRef<HTMLDivElement>(null);
const [width, setWidth] = useState(0);
const [height, setHeight] = useState(0);
const getDimensions = () => {
if (containerRef.current) {
setWidth(containerRef.current.offsetWidth);
setHeight(containerRef.current.offsetHeight);
<style>
td{
border: 1px solid black;
text-align: center;
}
</style>
<table>
<?php
$numero = 10;