Skip to content

Instantly share code, notes, and snippets.

View thgbrb's full-sized avatar

Thiago thgbrb

View GitHub Profile
@thgbrb
thgbrb / windows_dynamic_port.ps1
Created August 16, 2021 12:40
Ao executar um app/serviço no Windows 10 (ex: kestrel, tomcat, mysql) ocorre erro porque a porta está ocupada e no netstat não mostra nenhum processo escutando na porta
netsh int ipv4 show excludedportrange protocol=tcp
netsh int ipv4 set dynamic tcp start=49152 num=16384
@thgbrb
thgbrb / baseof.html
Created July 6, 2021 00:23 — forked from jeremybise/baseof.html
Google Fonts via config with Hugo
<!-- Wherever your head tag is located, add the new partial -->
<head>
{{ partial "google-fonts" . }}
</head>
@thgbrb
thgbrb / wp-config.php
Created April 20, 2021 04:20 — forked from MikeNGarrett/wp-config.php
All those damned wp-config constants you can never remember.
<?php
// PHP memory limit for this site
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit.
// Database
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database.
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users)
// Explicitely setting url
@thgbrb
thgbrb / web.config
Created September 4, 2019 20:06
Minimal Log4net config with file appender
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net>
<appender name="RollingFileAppenderAll" type="log4net.Appender.RollingFileAppender">
<file value="C:\TEMP\APP_NAME.txt" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<datePattern value=".yyyyMMdd" />
public static Task DoRequest(string url)
=> Task.Run(async () =>
{
await httpClient.GetStringAsync(requestUri: url);
Console.WriteLine($"{DateTime.Now} - Task completed.");
});
@thgbrb
thgbrb / JSON_Config.ps1
Created February 12, 2019 10:10 — forked from jhochwald/JSON_Config.ps1
How to use a JSON based config file with PowerShell Modules or Scripts
<#
{
"info": {
"Statement": "Code is poetry",
"Author": "Joerg Hochwald",
"Contact": "joerg.hochwald@outlook.com",
"Link": "http://hochwald.net",
"Support": "https://github.com/jhochwald/MyPowerShellStuff/issues"
},
"Copyright": "(c) 2012-2015 by Joerg Hochwald. All rights reserved."