Skip to content

Instantly share code, notes, and snippets.

View fagnercarvalho's full-sized avatar

Fagner Nunes Carvalho fagnercarvalho

View GitHub Profile
@fracasula
fracasula / context_cancel.go
Last active May 19, 2022 20:49
GoLang exiting from multiple go routines with context and wait group
package main
// Here's a simple example to show how to properly terminate multiple go routines by using a context.
// Thanks to the WaitGroup we'll be able to end all go routines gracefully before the main function ends.
import (
"context"
"fmt"
"math/rand"
"os"
@walm
walm / main.go
Last active November 5, 2024 16:22
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@fernandohu
fernandohu / Reading configuration files before application startup in Angular2 final release.md
Last active July 7, 2024 19:31
Reading configuration files before application startup in Angular2 final release

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

@CodeMyUI
CodeMyUI / index.html
Created August 3, 2016 08:30
wavePercent
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" style="display: none;">
<symbol id="wave">
<path d="M420,20c21.5-0.4,38.8-2.5,51.1-4.5c13.4-2.2,26.5-5.2,27.3-5.4C514,6.5,518,4.7,528.5,2.7c7.1-1.3,17.9-2.8,31.5-2.7c0,0,0,0,0,0v20H420z"></path>
<path d="M420,20c-21.5-0.4-38.8-2.5-51.1-4.5c-13.4-2.2-26.5-5.2-27.3-5.4C326,6.5,322,4.7,311.5,2.7C304.3,1.4,293.6-0.1,280,0c0,0,0,0,0,0v20H420z"></path>
<path d="M140,20c21.5-0.4,38.8-2.5,51.1-4.5c13.4-2.2,26.5-5.2,27.3-5.4C234,6.5,238,4.7,248.5,2.7c7.1-1.3,17.9-2.8,31.5-2.7c0,0,0,0,0,0v20H140z"></path>
<path d="M140,20c-21.5-0.4-38.8-2.5-51.1-4.5c-13.4-2.2-26.5-5.2-27.3-5.4C46,6.5,42,4.7,31.5,2.7C24.3,1.4,13.6-0.1,0,0c0,0,0,0,0,0l0,20H140z"></path>
</symbol>
</svg>
<div class="box">
<div class="percent">
@sillero
sillero / README.md
Last active March 4, 2016 10:38
React Porto Alegre
anonymous
anonymous / joshVR.xml
Created August 22, 2015 07:14
joshVR snapshot
<scene>
<cube scaleX="0.3" scaleY="10.00" translateY="1" translateX="1.00"/>
<cube scaleX="0.3" scaleY="10" translateY="1" translateX="2.00"/>
<cube scaleX="0.3" scaleY="10" translateY="1" translateX="3.00"/>
<cube scaleX="0.3" scaleY="10" translateY="1" translateX="5.00"/>
<cube scaleX="0.3" scaleY="10" translateY="1.0" translateX="-1.0"/>
<cube scaleX="0.3" scaleY="10" translateY="1.0" translateX="-2.0"/>
<cube scaleX="0.3" scaleY="10" translateY="1.0" translateX="-3.0"/>
@kentcdodds
kentcdodds / README.md
Last active October 27, 2015 13:41
One page site for First Timers Only concept

First Timers Only website idea

I wrote a blogpost on Medium last week about something I've been doing with my open source project. Check that out first: https://medium.com/@kentcdodds/first-timers-only-78281ea47455

It's had a fantastic response and people are enthusiastic about the idea. In an effort to encourage more projects to participate, I decided to file an issue on the up-for-grabs website repo and ask them if they would be willing to have a section dedicated to projects with first-timers-only issues.

If you checkout that issue, you see that Scott Hanselman has bought the domain firsttimersonly.com and wants to turn it into a one pager about the idea with links/resources/etc.

@denji
denji / golang-tls.md
Last active May 14, 2025 16:19 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@labaneilers
labaneilers / ASPNET-MVC-OSX-Apache.md
Last active April 14, 2024 23:20
Setting up ASP.NET MVC 5 via Mono on Mac OSX, with Apache

Install ASP.NET MVC 5 on Mono, Mac OSX, apache with mod_mono

Install mono MDK

  • NOTE: no x64 package is available (unless you want to install from source), so I installed the x86 version

  • Install mono MDK from:

http://www.mono-project.com/download/

I used 3.10.0, which corresponds to .NET 4.5

@peschlowp
peschlowp / transactions-sense-example
Last active November 21, 2019 04:00
Elasticsearch Sense contents to demonstrate how transactions with respect to search visibility may be implemented with parent-child relationships. Just copy paste into Sense and run the statements top to bottom.
# Transactions with parent-child relationships.
# Delete the index, just in case it still exists.
DELETE /myindex
# Create the index with a mapping for the actual documents and a mapping for the parent transaction type.
PUT /myindex
{
"mappings": {
"transaction": {