Skip to content

Instantly share code, notes, and snippets.

View iamronsuez's full-sized avatar
🤓

Ronald Suez iamronsuez

🤓
  • Santiago, Chile
View GitHub Profile
#!/bin/bash
# setup_git_aliases.sh
# This script sets up useful Git aliases both as Git config aliases and shell aliases
# It checks if Git is installed first and provides feedback at each step
# Function to display messages with color
print_message() {
echo -e "\033[1;34m$1\033[0m"
}
@iamronsuez
iamronsuez / esm-package.md
Created October 20, 2024 22:18 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
{
"businessId": 8,
"name": "NxM prueba",
"available": true,
"days_enabled": false,
"delivery_quantity": "20",
"final_date": "2022-01-13",
"free_delivery": false,
"hours_enabled": false,
"init_date": "2022-01-12",
salesChannels: [{id: "27", name: "JumboAhora Bilbao", store: "J501", __typename: "SalesChannel"},…]
0: {id: "27", name: "JumboAhora Bilbao", store: "J501", __typename: "SalesChannel"}
1: {id: "31", name: "JumboAhora Kennedy", store: "J502", __typename: "SalesChannel"}
2: {id: "35", name: "JumboAhora Maipu", store: "J503", __typename: "SalesChannel"}
3: {id: "18", name: "JumboAhora La Florida", store: "J510", __typename: "SalesChannel"}
4: {id: "26", name: "JumboAhora Concepción", store: "J511", __typename: "SalesChannel"}
5: {id: "36", name: "JumboAhora La Reina", store: "J512", __typename: "SalesChannel"}
6: {id: "22", name: "JumboAhora El Llano", store: "J513", __typename: "SalesChannel"}
7: {id: "34", name: "JumboAhora La Dehesa", store: "J514", __typename: "SalesChannel"}
8: {id: "37", name: "JumboAhora Peñalolen", store: "J519", __typename: "SalesChannel"}
https://www.apollographql.com/docs/apollo-server/data/data-sources/
https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-cache-redis
https://medium.com/brikl-engineering/serverless-graphql-cached-in-redis-with-apollo-server-2-0-f491695cac7f
{
"GroupDefinitions": [
{
"Type": "DIMENSION",
"Key": "AZ"
}
],
"ResultsByTime": [
{
"TimePeriod": {
@iamronsuez
iamronsuez / App.js
Last active July 11, 2019 04:17
Simple WebSocket React
import React from 'react'
import './App.css'
import socketIOClient from 'socket.io-client'
class App extends React.Component {
state = {
endpoint: 'https://ddf34c69.ngrok.io/',
ts: new Date(),
data: {}
}

Run each of the following lines, replacing yourdomain.com and codehere with your details:

now dns add yourdomain.com @ TXT google-site-verification=codehere
now dns add yourdomain.com @ MX ASPMX.L.GOOGLE.COM 1
now dns add yourdomain.com @ MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT3.ASPMX.L.GOOGLE.COM 10
now dns add yourdomain.com @ MX ALT4.ASPMX.L.GOOGLE.COM 10

Comittizen Setup

Install node

  • install node latest

Install dependencies

  • git init (if the project does not have git initalized)
  • npm init or (copy the format below)

Setup