Skip to content

Instantly share code, notes, and snippets.

View ErickWendel's full-sized avatar

Erick Wendel ErickWendel

View GitHub Profile
if (new URLSearchParams(window.location.search).get('portal')) {
// <create start portal>
// Create portal group to contain all portal elements
const startPortalGroup = new THREE.Group();
startPortalGroup.position.set(SPAWN_POINT_X, SPAWN_POINT_Y, SPAWN_POINT_Z);
startPortalGroup.rotation.x = 0.35;
startPortalGroup.rotation.y = 0;
// Create portal effect
@RafaelGSS
RafaelGSS / .zshrc
Created January 12, 2025 02:32
Use npx with Node.js Permission Model
alias npx-safe='function _npx_safe() {
local node_opts="--permission --allow-fs-read=$(npm prefix -g) --allow-fs-read=$(npm config get cache)"
local package=""
local package_args=()
while [[ $# -gt 0 ]]; do
if [[ "$1" == --* ]]; then
# Anything starting with `--` goes into node_opts
node_opts+=" $1"
@khaosdoctor
khaosdoctor / 1-criar-cluster-kind.sh
Last active May 26, 2025 18:01
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 July 1, 2025 02:01
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 13, 2024 04:15
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 February 5, 2025 15:27
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 March 16, 2025 13:43
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
}