Skip to content

Instantly share code, notes, and snippets.

View 6Jonathan6's full-sized avatar
😀

Jonathan Pérez Rodríguez 6Jonathan6

😀
  • Ciudad de México
View GitHub Profile
@6Jonathan6
6Jonathan6 / gist:d12f5fc024ee3c19ab1c36182b520bfc
Created April 23, 2024 20:51
Actualizar dependencias de un package.json
ncu
ncu -u
npm install
new Date(2022,04,23).toLocaleString( 'en-US', { timeZoneName: 'short',timeZone:'America/Mexico_City' } );
// Para obtener la el time zone del browser
Intl.DateTimeFormat().resolvedOptions().timeZone
@6Jonathan6
6Jonathan6 / gist:cde6cc1eb537d84ef776b160789ced37
Last active July 14, 2022 23:46
Agregar divisor al centro de la pantalla
<div
style={{
height: '100vh',
width: '10px',
background: 'red',
position: 'fixed',
left: 0,
right: 0,
margin: 'auto',
top: 0,
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
eval "$(pyenv virtualenv-init -)"
function decimalToBinary(decimal){
return decimal.toString(2)
}
function decimalToHex(decimal){
return decimal.toString(16)
}
function hexToBinary(hex){
return hex.toString(2)
}
function hexToBinary(hex){
@6Jonathan6
6Jonathan6 / js
Created November 13, 2020 18:10
Cargar un archivo xlsx a un input[type="file"] en cypress apartir de un fixture
Then('Subo un el archivo de tipo .xlsx', () => {
// filename archivo localizado en cypress/fixtures/{fileName}
Cypress.Commands.add('upload_file', (fileName, selector) => {
return cy.get(selector).then((subject) => {
// Cargamos el fixture que debe estar en cypress/fixtures/{fileName} y lo cargamos como un base64
return cy.fixture(fileName, 'base64').then((base64) => {
// Base 64 a blob
const blob = Cypress.Blob.base64StringToBlob(
base64,
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
@6Jonathan6
6Jonathan6 / html
Last active November 13, 2020 18:12
Embbed pdf in a iframe
<div>
<div>
<object
data='https://pdfjs-express.s3-us-west-2.amazonaws.com/docs/choosing-a-pdf-viewer.pdf'
type="application/pdf"
width="500"
height="678"
>
<iframe