Skip to content

Instantly share code, notes, and snippets.

View viniciusCamargo's full-sized avatar
🧙‍♂️

Vinicius de Sousa Camargo viniciusCamargo

🧙‍♂️
View GitHub Profile
@ironbyte
ironbyte / seed_drizzle_zod_faker.ts
Last active April 28, 2024 15:22
TS Seed Script: Drizzle ORM + Zod + Faker (Minimal)
// tsx seed.ts
import { faker } from '@faker-js/faker';
import { pgTable, text, varchar, timestamp } from 'drizzle-orm/pg-core';
import { drizzle, PostgresJsDatabase } from 'drizzle-orm/postgres-js';
import { createInsertSchema } from 'drizzle-zod';
import { customAlphabet } from 'nanoid';
import postgres from 'postgres';
import { z } from 'zod';
@dotja
dotja / nginx-https.md
Last active January 20, 2024 07:03
Configure Nginx with HTTPS

Nginx/HTTPS Configuration

About

HTTPS is when HTTP (hypertext transfer protocol); a communication protocol, is encrypted using TLS (transport layer security).

This means that if anyone is eavesdropping on the communication between a server and a client, they will eavesdrop on encrypted data that is hard to decipher and is therefore secure.

TLS is the more recent term which replaces the term SSL (secure socket layer) but we can refer to them as SSL/TLS.

@viniciusCamargo
viniciusCamargo / .prettierrc
Last active April 24, 2023 22:37
.prettierrc
{
"bracketSameLine": true,
"quoteProps": "consistent",
"singleQuote": true,
"jsxSingleQuote": true,
"semi": false,
"trailingComma": "none"
}
@viniciusCamargo
viniciusCamargo / multiple_ssh_setting.md
Last active August 3, 2023 00:01 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different Github accounts

github multiple keys

$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/{private_key}
$ git clone git@{alias}:{github_user}/{repo}.git

~/.ssh/config

@timhughes
timhughes / fastapi_websocket_redis_pubsub.py
Last active April 29, 2024 08:00
FastAPI Websocket Bidirectional Redis PubSub
"""
Usage:
Make sure that redis is running on localhost (or adjust the url)
Install uvicorn or some other asgi server https://asgi.readthedocs.io/en/latest/implementations.html
pip install -u uvicorn
Install dependencies
@slmingol
slmingol / AdList.txt
Created February 23, 2020 19:01 — forked from hermanjustinm/AdList.txt
Ad Block List
##StevenBlack's list
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
##MalwareDomains
https://mirror1.malwaredomains.com/files/justdomains
##Cameleon
http://sysctl.org/cameleon/hosts
##Zeustracker
const express = require('express');
const htm = require('htm');
const vhtml = require('vhtml');
// create an html`` tag function for vhtml:
const html = htm.bind(vhtml);
const App = (props) => html`
<div class="app">
<h1>This is an app</h1>
const express = require('express');
const { html, Component } = require('htm/preact');
const renderToString = require('preact-render-to-string');
class App extends Component {
render(props) {
return html`
<div class="app">
<h1>This is an app</h1>
<p>Current server time: ${new Date + ''}</p>
@viniciusCamargo
viniciusCamargo / preact.html
Created February 14, 2019 13:28
Preact without JSX + lifecycle methods
<!-- Reference: https://github.com/developit/preact-without-babel/ -->
<!DOCTYPE html>
<html lang="en">
<head>
<style>
#header {
opacity: 1;
transition: opacity 1s;
}
@branflake2267
branflake2267 / main.dart
Created April 24, 2018 04:02
Flutter - Alert Dialogs
import 'dart:async';
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(