Skip to content

Instantly share code, notes, and snippets.

View gtkatakura's full-sized avatar

gtkatakura

View GitHub Profile
const fsp = require("fs").promises;
const path = require("path");
const { execSync } = require("child_process");
const chalk = require("chalk");
const Confirm = require("prompt-confirm");
const jsonfile = require("jsonfile");
const semver = require("semver");
const packagesDir = path.resolve(__dirname, "../packages");
@gtkatakura
gtkatakura / esbuild-relay.js
Created February 24, 2021 14:01 — forked from sciyoshi/esbuild-relay.js
Esbuild plugin for compiling relay queries
import { promises } from "fs";
import crypto from "crypto";
import path from "path";
import { print, parse } from "graphql";
const plugin = {
name: "relay",
setup: build => {
build.onLoad({ filter: /\.tsx$/, namespace: "" }, async args => {
let contents = await promises.readFile(args.path, "utf8");
@gtkatakura
gtkatakura / using-uuid-as-pk.md
Created December 30, 2020 10:31 — forked from rponte/using-uuid-as-pk.md
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

/*
your obj pointer came in the first position of the stack
so you will load it on a register
*/
movl (%esp), %eax ;
/*
then you want to do obj.a += 6, if we suppose
that we're talking about records not dictionaries
let level = 1
const execute = (callback) => {
level++;
callback()
level--;
}
const print = text => {
console.log(' '.repeat(level) + text)
import { useContext, useState } from 'react';
import { ApolloContext } from 'react-apollo';
import useDeepCompareEffect from 'use-deep-compare-effect';
const useQuery = (query, { variables }) => {
const { client } = useContext(ApolloContext);
const [state, setState] = useState({
loading: true,
});

sudo apt-get install net-tools

sudo apt-get install openssh-server

ssh-copy-id