Skip to content

Instantly share code, notes, and snippets.

View sibelius's full-sized avatar
🦈
give me a feedback https://entria.feedback.house/sibelius

Sibelius Seraphini sibelius

🦈
give me a feedback https://entria.feedback.house/sibelius
View GitHub Profile
@sibelius
sibelius / mongodb-rs.sh
Created November 13, 2024 18:09
mongodb-rs.sh
args="$@"
docker-compose up -d $args
sleep 5
updateEtcHost() {
local content=$1
if grep -q "$content" /etc/hosts; then
@sibelius
sibelius / validateWhatsAppSha256.ts
Created October 28, 2024 13:18
validate whatsapp sha 256
const signature = ctx.request.headers['x-hub-signature-256'];
if (
!signature ||
typeof signature !== 'string' ||
!config.WHATSAPP_APP_SECRET
) {
ctx.status = 403;
ctx.body = {
message: 'invalid signature',
import legacy from '@vitejs/plugin-legacy'
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import relay from 'vite-plugin-relay';
// import { esbuildCommonjs, viteCommonjs } from '@originjs/vite-plugin-commonjs'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
// commonjs({
@sibelius
sibelius / renderToPipeableStreamPromise.ts
Created August 20, 2024 11:42
renderToPipeableStreamPromise
export const renderToPipeableStreamPromise = async (
tree: ReactElement,
ctx: Context,
next: Next,
) => {
const writableStream = new WritableAsPromise();
let didError = false;
const { pipe, abort } = renderToPipeableStream(tree, {
@sibelius
sibelius / ReloadServerPlugin.js
Created August 1, 2024 03:15
ReloadServerPlugin.js
const cluster = require('cluster');
const path = require('path');
const defaultOptions = {
script: 'server.js',
execArgv: [],
};
class ReloadServerPlugin {
constructor({ script, execArgv = [] } = defaultOptions) {
@sibelius
sibelius / woovi-frontend-review-feedback.md
Last active July 19, 2024 12:53
woovi-frontend-review-feedback

These are review based on woovi frontend junior challenge

  • deploy frontend
  • select a bundling tools like nextjs, vite, webpack or rspack
  • use css in js
  • make proper components
  • avoid hard coded values like colors, spacing, typography
  • create a mini design system
  • use a form library like formik
  • use a validation library like yup
@sibelius
sibelius / woovi-learning.md
Last active July 12, 2024 19:06
O que aprendi trabalhando na Woovi ?

Vi que os problemas e as resoluções precisam ser discutidos e compartilhados.

Escrever uma issue primeiro é muito melhor que sair codando.

Conheci várias ferramentas super úteis para front, tipo o Clarity.

Pude aprender conceitos de filas, webhook, feature flags. Assuntos que eu não conhecia até então. A tarefa dos e-mails foi muito boa para aprender como criar um job e como funcionam as filas. Uma das coisas que mais gostei de aprender.

Como eu ainda não tinha trabalhado em uma empresa nessa área, foi absolutamente tudo novo. Desde rotina de daily, apresentar e como apresentar algo, escrever documentação, escrever como testar uma nova funcionalidade, enfim tudo isso foi aprendizado também.

@sibelius
sibelius / agile-questions.md
Last active July 30, 2024 19:59
agile-questions
  • do you use feature flags? expand
  • do you use git flow?
  • have you decoupled deploy from release? https://www.honeycomb.io/blog/deploys-wrong-way-change-user-experience
  • do you use sprints?
  • do you have automated tests?
  • do you do refactoring?
  • do you use types (typescript)?
  • how do you manage the project?
  • do you have daily meetings? expand
  • do you have written documentation?
@sibelius
sibelius / metabaseEmbedResolver.spec.ts
Created May 17, 2024 12:14
metabase graphql resolver
export const metabaseEmbedResolver = {
metabaseEmbedUrl: {
type: GraphQLString,
args: {
question: {
type: new GraphQLNonNull(GraphQLString),
},
params: {
type: GraphQLString,
},
@sibelius
sibelius / slack-daily.ts
Last active April 20, 2024 16:46
basic script to tag people that forget to answer daily thread
import { slackApp } from '../src/slackApp';
import { generalChannelId } from '../src/slackChannels';
import { config } from '../src/config';
import {
filterBots,
replaceMembers,
} from '../src/slack/membersMapping';
import { removeRepliedUsers } from '../src/commandMessage/dailyThreadCommand';
import { unique } from '../src/core/unique';
import { slackAllMembers } from '../src/slack/slackAllMembers';