Skip to content

Instantly share code, notes, and snippets.

View ChristoPy's full-sized avatar
🏠
Working from home

Christopher Ribeiro ChristoPy

🏠
Working from home
View GitHub Profile
@marcosrjjunior
marcosrjjunior / kysely + turso + migrations (sqlite)
Last active March 5, 2025 15:33
Kysely + Turso + Migrations
{
"scripts": {
// ...
"db:migrate:up": "bun run -r dotenv/config ./src/lib/db/migrate latest",
"db:migrate:down": "bun run -r dotenv/config ./src/lib/db/migrate down",
"db:migrate:create": "bun run -r dotenv/config ./src/lib/db/migrate create initial",
"db:generate:types": "bunx kysely-codegen --out-file=src/lib/db/schema/Database.ts",
},
"dependencies": {
"kysely": "^0.27.3",
  1. Install airbnb-base npx install-peerdeps --dev eslint-config-airbnb-base

  2. Install required dependencies npm i -D typescript eslint prettier prettier-eslint-cli eslint-config-prettier eslint-plugin-prettier eslint-config-node eslint-plugin-node @typescript-eslint/eslint-plugin @typescript-eslint/parser

  3. Add .eslintrc.json with the following code:

{
  "root": true,
@kcak11
kcak11 / App.md
Last active April 15, 2025 11:32
Country Codes

Country Codes

List of all Country Codes (ISO & Dialing) sorted in alphabetical order.

@Gustavo-Kuze
Gustavo-Kuze / setup_prettier_eslint_airbnb.md
Last active January 20, 2025 18:32
Como configurar o Prettier/ESLint com o preset do AirBnb em projetos React e NodeJS

Como configurar o Prettier/ESLint com o preset do AirBnb em projetos React e NodeJS

ReactJS

  1. Instale as seguintes dependencias em seu projeto React:
yarn add -D babel-eslint prettier eslint-config-prettier eslint-plugin-prettier eslint eslint-plugin-react eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-import eslint-import-resolver-webpack
@peterhellberg
peterhellberg / minimal-server.go
Created May 16, 2018 19:16
A pretty minimal HTTP server example in Go
package main
import (
"io/ioutil"
"log"
"net/http"
"os"
"time"
)
@vikas5914
vikas5914 / makeCert.bat
Created January 22, 2018 13:02
Generate a self-signed certificate for localhost
@echo off
REM IN YOUR SSL FOLDER, SAVE THIS FILE AS: makeCERT.bat
REM AT COMMAND LINE IN YOUR SSL FOLDER, RUN: makecert
REM IT WILL CREATE THESE FILES: example.cnf, example.crt, example.key
REM IMPORT THE .crt FILE INTO CHROME Trusted Root Certification Authorities
REM REMEMBER TO RESTART APACHE OR NGINX AFTER YOU CONFIGURE FOR THESE FILES
REM PLEASE UPDATE THE FOLLOWING VARIABLES FOR YOUR NEEDS.
SET HOSTNAME=example
@loilo
loilo / bubble.md
Last active April 27, 2023 00:21
Make Vue events bubble

Make Vue events bubble

Vue events don't bubble the component tree on their own. However when writing wrapper components this can be the desired behaviour.

This code registers a global bubble directive which allows to re-emit all given events:

Let's say we want to bubble events start, accelerate and brake of our component Car.

Without any help, we'd roughly have to do this:

@therightstuff
therightstuff / _end-to-end-enc.js.md
Last active December 19, 2023 02:17
Javascript / Node.js end-to-end encryption
@pachacamac
pachacamac / codepenclone.html
Created April 29, 2016 12:52
Mini Codepen Clone with sharing function
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>MiniCodepenClone</title>
<style>
body,textarea,iframe{ margin:0; box-sizing:border-box; }
textarea,iframe { width:100%; height:50vh; float:left; }
textarea { color:#eee; background:#111; font-family:monospace; font-size:11pt; line-height:1.4; width:33.33%; }
#shareBtn { position:absolute; bottom:0; left:0; }
@paullewis
paullewis / requestIdleCallback.js
Last active April 23, 2025 04:07
Shims rIC in case a browser doesn't support it.
/*!
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software