Skip to content

Instantly share code, notes, and snippets.

Avatar

Carlos Tosta jctosta

  • Rio de Janeiro, Brazil
View GitHub Profile
@jctosta
jctosta / docker-wsl2-memory-limits.md
Created Jun 14, 2021
You can limit docker-windows memory usage by adjusting some parameters in wsl2 configuration.
View docker-wsl2-memory-limits.md

Limit WSL2 Memory Usage when using Docker for Windows

You can limit docker-windows memory usage by adjusting some parameters in wsl2 configuration.

First, close any instances of Docker Windows currently running and create a new file named .wslconfig in your user home directory, like C:\Users<username>:

[wsl2]
memory=4GB
processors=5
@jctosta
jctosta / lightning_mage_filter.xml
Last active May 29, 2021
Last Epoch Lightning Mage Filter
View lightning_mage_filter.xml
<?xml version="1.0" encoding="utf-8"?>
<ItemFilter xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<name>Lightning Mage</name>
<filterIcon>17</filterIcon>
<filterIconColor>1</filterIconColor>
<description />
<lastModifiedInVersion>0.8.2f</lastModifiedInVersion>
<lootFilterVersion>0</lootFilterVersion>
<rules>
<Rule>
@jctosta
jctosta / init_postgres_windows.md
Last active Sep 10, 2021
A simple guide on initializing the Windows version of Postgres using the zip file instead of msi installer
View init_postgres_windows.md
@jctosta
jctosta / GoogleSheets.gs
Created May 29, 2019
A google script to log web service data in a drive sheets
View GoogleSheets.gs
function deg2rad(deg) {
return deg * (Math.PI / 180);
}
function getDistanceFromLatLongInKm(lat1, lon1, lat2, lon2) {
var R = 6371; // Raio do Planeta Terra em KM
var dLat = deg2rad(lat2 - lat1);
var dLon = deg2rad(lon2 - lon1);
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
@jctosta
jctosta / vscode-extensions.md
Last active Oct 16, 2021
Recomendação de Extensões - VSCode
View vscode-extensions.md
View canvas.json
{
"canvas": {
"parcerias_principais": {
"title": "Parcerias Principais",
"color": "blue_canvas",
"cards": [
{ "label": "Loja de Noivas", "description": "" },
{ "label": "Lojas de Aniversário", "description": "" },
{ "label": "Animadores de Festa", "description": "" },
{ "label": "Empresas de Entrega", "description": "" }
View programming_tips.md

Programming Tips (Dicas de Programação)

Linguagem C

Definir Locale para exibição de caractéres acentuados no console

Incluir a biblioteca locale.h no cabeçalho da página:

#include <locale.h>
@jctosta
jctosta / wireless_doorbell_nodemcu.cpp
Created Mar 7, 2017
Wireless Doorbell with NodeMCU and IFTTT Maker Channel
View wireless_doorbell_nodemcu.cpp
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#define BUTTON 4
int buttonState = 0;
const char* ssid = "<wifi_ssid>";
const char* password = "<wifi_password>";
@jctosta
jctosta / nerdtech2.md
Last active Jul 24, 2017 — forked from peas/nerdtech2.md
Links que citamos no NerdTech #2
View nerdtech2.md
@jctosta
jctosta / unsetProxyEnv.sh
Created Nov 8, 2015
Remove configurações de proxy em ambientes Linux
View unsetProxyEnv.sh
# Terminal Settings (WGET, Apt e etc.)
unset http_proxy
unset https_proxy
unset ftp_proxy
unset rsync_proxy
unset no_proxy
# Configurações para proxy automático em ambientes Gnome
if hash gsettings 2>/dev/null; then
gsettings set org.gnome.system.proxy mode 'none'