Skip to content

Instantly share code, notes, and snippets.

View pablohdzvizcarra's full-sized avatar
🛏️
Need Sleep

Pablo Hernandez pablohdzvizcarra

🛏️
Need Sleep
View GitHub Profile
@pablohdzvizcarra
pablohdzvizcarra / get-coordinates.txt
Last active April 18, 2020 01:10
get coordinates of an element
function getCoords(elem) {
let box = elem.getBoundingClientRect();
return {
top: box.top + window.pageYOffset,
left: box.left + windows.pageXOffset
}
}
// add an element with the coordinates obtained
@pablohdzvizcarra
pablohdzvizcarra / algorithm response style-components
Created August 12, 2020 21:45
how to make your style components with response to the screen
import { breakpoints } from "./_variables";
import { css } from "styled-components";
export const respondTo = Object.keys(breakpoints).reduce(
(accumulator, label) => {
accumulator[label] = (...args) => css`
@media (min-width: ${breakpoints[label]}) {
${css(...args)};
}
`;
@pablohdzvizcarra
pablohdzvizcarra / response media querys
Last active August 12, 2020 21:45
media querys style-components
export const breakpoints = {
xs: "480px",
sm: "768px",
md: "992px",
lg: "1200px",
xg: "1600px",
};
// how to use them
async getMarkers() {
const events = await firebase.firestore().collection('events')
events.get().then((querySnapshot) => {
const tempDoc = querySnapshot.docs.map((doc) => {
return { id: doc.id, ...doc.data() }
})
console.log(tempDoc)
})
}

#Configurando Git y GitHub en OSX y Linux ##GIT GIT en un software de control de versiones que fue diseñado por Linus Torvalds, desde sus inicios fue pensado para que operara cono un software de bajo nivel y que otros se encargaran de crear la interfaz grafica o front-end. pero hoy en día GIT es un software de control de versiones con funcionalidad plena, 100% en la terminal. Si bien es cierto que hoy en día existen varios software con interfaz gráfica, que nos permiten operar con GIT, aquí lista de Guis para Git, en este post nos concentraremos en la instalación y configuración de GIT desde la terminal tanto en Linux como en OSX. ###Instalando GIT en Linux La instalación de GIT en Linux es extremadamente fácil, dependiendo de la versión de Linux que estés usando va a cambiar el gestor de paquetes que necesitemos usar, pero antes de instalar primero verifiquemos si es que ya esta instalado, para la cu

@pablohdzvizcarra
pablohdzvizcarra / setup.md
Created November 9, 2020 02:07 — forked from xirixiz/Set up GitHub push with SSH keys.md
Set up GitHub push with SSH keys

Create a repo. Make sure there is at least one file in it (even just the README) Generate ssh key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings. Test SSH key:

ssh -T git@github.com
@pablohdzvizcarra
pablohdzvizcarra / curl.md
Created November 9, 2020 05:47 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

este es un gist de prueba
esta creado por el interes de aprender de una manera correcta github cli
@pablohdzvizcarra
pablohdzvizcarra / cloudSettings
Last active December 7, 2020 00:05
Configuration Visual Studio Code
{"lastUpload":"2020-12-07T00:05:08.400Z","extensionVersion":"v3.4.3"}
@pablohdzvizcarra
pablohdzvizcarra / UsersDAO.ts
Created February 25, 2021 18:33
Data Access Object
import { Collection, MongoClient } from 'mongodb'
import User from '../lib/User'
import * as bcrypt from 'bcrypt'
import aggregateRooms from '../Room/Shared/mongodb/aggregateRooms'
let users: Collection
export type UserFromDB = {
_id: string
name: string