Skip to content

Instantly share code, notes, and snippets.

View ErickWendel's full-sized avatar

Erick Wendel ErickWendel

View GitHub Profile
@khaosdoctor
khaosdoctor / 1-criar-cluster-kind.sh
Last active February 22, 2023 23:39
Scripts e comandos que eu faço no vídeo sobre KinD com Kubernetes: https://www.youtube.com/watch?v=dL19dSGKZoc
kind create cluster --name demo-cluster
kind get clusters
kubectl config get-contexts
@rponte
rponte / using-uuid-as-pk.md
Last active June 29, 2024 15:42
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

@lhorie
lhorie / longest-keyword-sequence.md
Last active November 14, 2022 23:21
What's the longest keyword sequence in Javascript?
@pyldin601
pyldin601 / Dockerfile
Created September 20, 2018 07:46
Multi-stage build of typescript node application example
FROM node:10
ENV NODE_ENV=development
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . ./
RUN npm run build
FROM node:10
ENV NODE_ENV=production
@thebuilder
thebuilder / jest.config.js
Last active October 29, 2022 02:42
Use Jest Projects to run both JSDom and Node tests in the same project
module.exports = {
projects: [
{
displayName: 'dom',
testEnvironment: 'jsdom',
snapshotSerializers: ['enzyme-to-json/serializer'],
testMatch: ['**/__tests__/**/*.test.js?(x)']
},
{
displayName: 'node',

Version 10.0.0

  • Assert
    • Calling assert.fail() with more than one argument is deprecated. [70dcacd710]
    • Calling assert.ok() with no arguments will now throw. [3cd7977a42]
    • Calling assert.ifError() will now throw with any argument other than undefined or null. Previously the method would throw with any truthy value. [e65a6e81ef]
    • The assert.rejects() and assert.doesNotReject() methods have been added for working with async functions. [599337f43e]
  • Async_hooks
    • Older experimental async_hooks APIs have been removed. [1cc6b993b9]
  • Buffer
@jkrems
jkrems / es-module-history.md
Last active November 5, 2023 19:35
History of ES modules

Modules - History & Future

History

@inodaf
inodaf / create-observable.js
Last active June 24, 2020 20:05
👀 Object Observable using ES6 Proxies.
function createObservable(observable, { onGet, onSet }) {
const interceptor = {
get(target, key, receiver) {
onGet(key)
return target[key]
},
set(target, prop, value) {
onSet(prop, value)
return true
}
@theKashey
theKashey / preoxyquire.js
Created December 12, 2017 02:17
"Proxyquire" inside the Jest
// anywhere
import proxyquire from '....../proxyquire.js'
// proxyquire.js
// use rewiremock to mock proxyquire
import rewiremock, { addPlugin, plugins, overrideEntryPoint } from 'rewiremock';
import stackTrace from 'stack-trace';
rewiremock.requireActual('babel-register');
@thilinapiy
thilinapiy / mongo-statefulset.yaml
Created October 27, 2017 12:21
MongoDB statefulset for kubernetes with authentication and replication
## Generate a key
# openssl rand -base64 741 > mongodb-keyfile
## Create k8s secrets
# kubectl create secret generic mongo-key --from-file=mongodb-keyfile
---
apiVersion: v1
kind: Service
metadata:
name: mongo
labels: