Skip to content

Instantly share code, notes, and snippets.

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

Lucas Saliés Brum sistematico

🏠
Working from home
View GitHub Profile
@sistematico
sistematico / clear-planetscale-db-drizzle.ts
Created April 13, 2024 16:31 — forked from ThimoDEV/clear-planetscale-db-drizzle.ts
A simple script to clear all the data of your planetscale DB (force-reset from PrismaORM)
// db.ts
import * as schema from "./schema"
export const db = drizzle(connection, { schema })
//reset.ts
async function reset() {
const tableSchema = db._.schema
if (!tableSchema) {
throw new Error("No table schema found")
@sistematico
sistematico / git_large_file.md
Created April 4, 2024 23:01 — forked from naviocean/git_large_file.md
Fixing the “GH001: Large files detected. You may want to try Git Large File Storage.”

Fixing the “GH001: Large files detected. You may want to try Git Large File Storage.”

I just migrated my repositories from BitBucket to GitHub but, suddenly, I received an interesting error when I tried to push a repo with some large files inside.

remote: error: GH001: Large files detected. You may want to try Git Large File Storage — https://git-lfs.github.com.
remote: error: Trace: b5116d865251981c96d4b32cdf7ef464
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File fixtures/11_user_answer.json is 131.37 MB; this exceeds GitHub’s file size limit of 100.00 MB
@sistematico
sistematico / nodejs
Last active January 12, 2024 18:19 — forked from wwwdata/gist:11217377
FreeBSD service script for Node.js
#!/bin/sh
# PROVIDE: nodejs
# REQUIRE: NETWORKING SERVERS DAEMON
# BEFORE: LOGIN
# File: /etc/rc.d/nodejs
# https://docs.freebsd.org/en/articles/rc-scripting
# https://man.freebsd.org/cgi/man.cgi?query=daemon
@sistematico
sistematico / GitCommitEmoji.md
Created September 28, 2023 10:54 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@sistematico
sistematico / index.js
Last active March 21, 2023 07:32 — forked from uelsson/files.js
Node.js - Como listar arquivos com fs, path
// Original em: https://youtu.be/Eeqyi6W4CqY
import fs from 'fs'
import path from 'path'
let data = []
function listarArquivos(dir) {
const directories = fs.readdirSync(dir)
@sistematico
sistematico / gh-pages-deploy.md
Created July 22, 2022 01:25 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@sistematico
sistematico / certbot setup guideline.md
Created July 20, 2022 23:09 — forked from AoiYamada/certbot setup guideline.md
Certbot auto renew SSL guideline for CentOS 6, 7

Certbot auto renew SSL guideline for CentOS 6, 7

Sign a ssl cert and renew by cronjob.

Prerequisite

softwares:

  • wget
  • nginx
  • nano
@sistematico
sistematico / gist:5f34e3d8036f90ea3dfd35f6f4151329
Created March 19, 2022 23:52 — forked from felladrin/gist:1800645
Código PHP para listar subpastas com links
<?php
if ($diretorio = opendir("./"))
{
while(false !== ($pasta = readdir($diretorio)))
{
if(is_dir($pasta) and ($pasta != ".") and ($pasta != ".."))
{
echo "<a href='$pasta'>$pasta</a><br>";
}
}
@sistematico
sistematico / index.html
Created January 19, 2022 11:08 — forked from gdams/index.html
Webssh
<!doctype html>
<html>
<head>
<title>SSH Client</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.5/socket.io.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<style>
body {
margin: 0;
padding: 0;