Skip to content

Instantly share code, notes, and snippets.

View guilhermerodrigues680's full-sized avatar

Guilherme Rodrigues guilhermerodrigues680

View GitHub Profile
@TheoOkafor
TheoOkafor / index.js
Last active September 8, 2023 10:38
Setup for running an SQL Queries from file in a NodeJS App (SQLite)
// Require or import the dependencies
const fs = require("fs");
const sqlite3 = require("sqlite3").verbose();
// Read the SQL file
const dataSql = fs.readFileSync("./data.sql").toString();
// Setup the database connection
let db = new sqlite3.Database("mydatabase", err => {
if (err) {
@altwitt
altwitt / animated-3d-globe-webgl-three-js.markdown
Created November 30, 2019 03:46
Animated 3D Globe (WebGL/three.js)
@dalezak
dalezak / README.md
Last active September 11, 2023 09:51
Ionic Capacitor Resources Generator
  1. Run npm install cordova-res --save-dev
  2. Create 1024x1024px icon at resources/icon.png
  3. Create 2732x2732px splash at resources/splash.png
  4. Add "resources": "cordova-res ios && cordova-res android && node scripts/resources.js" to scripts in package.json
  5. Copy resources.js file to scripts/resources.js
  6. Run sudo chmod -R 777 scripts/resources.js
  7. Run npm run resources
@brandonjp
brandonjp / findOverflowParents.js
Last active May 3, 2024 09:17
find overflow:hidden ancestors
// when you're trying to use `position:sticky` on an element
// you'll have trouble if any parent/ancestor element has
// overflow set to anything other than "visible" (such as: auto,hidden,overlay,scroll)
// & turns out if a parent is `display:flex` it might need some love
// (to remedy this you can set the `align-self` of your sticky element)
// see here for how the display & align-self properties affect: http://bit.ly/2ZaRu4o
// so, to find those troublesome parents...
// copy & paste this into Chrome Inspector/Dev Tools console
// (and be sure to change the #stickyElement below, if needed)
@bradtraversy
bradtraversy / docker_wordpress.md
Last active May 4, 2024 09:16
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@CJEnright
CJEnright / gzip.go
Last active December 19, 2023 19:40
Idiomatic golang net/http gzip transparent compression, an updated version of https://gist.github.com/bryfry/09a650eb8aac0fb76c24
package main
import (
"net/http"
"compress/gzip"
"io/ioutil"
"strings"
"sync"
"io"
)
@Integralist
Integralist / Long and Short Flag.go
Last active January 3, 2024 19:35
[Golang Long and Short Flags] #go #golang #flags
var myFlagType string
func init() {
const (
flagValue = "default value is foo"
flagUsage = "this is my flag explanation"
)
flag.StringVar(&myFlagType, "foo", flagValue, flagUsage)
flag.StringVar(&myFlagType, "f", flagValue, flagUsage+" (shorthand)")
flag.Parse()
@brunoarmanelli
brunoarmanelli / UsodaAPIdoSIU.md
Last active April 18, 2024 19:55
Pesquisa e Documentação - SIU Mobile

Projeto ChatBUS - Uso da API do SIU Mobile

Muitas frustrações com o aplicativo oficial SIU Mobile me motivaram a escrever essa documentação. Toda a API foi especificada com o máximo de informações encontradas.

Nota do Autor

Este documento é totalmente privado e foi disponibilizado em link de Gist secreto para uso interno nas empresas que representam o SIU Mobile BH.

Todo o conteúdo foi observado através da transmissão de dados pela rede. Não foi utilizado nenhum código da aplicação.

@KaMeHb-UA
KaMeHb-UA / .bashrc
Created March 18, 2018 16:13
Beautiful and useful .bashrc example for TRUECOLOR terminals
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
@bmaupin
bmaupin / free-backend-hosting.md
Last active May 3, 2024 18:14
Free backend hosting