Skip to content

Instantly share code, notes, and snippets.

View FusRoDah061's full-sized avatar

Allex Rodrigues FusRoDah061

  • Nelogica
  • Campinas - SP
View GitHub Profile
public class AsyncTask<T>
{
private BackgroundWorker _worker;
public bool Success { get; private set; }
public Exception Error { get; private set; }
public T Data { get; set; }
public bool WaitingCancelation { get
{
@FusRoDah061
FusRoDah061 / ServiceInstaller.cs
Last active December 5, 2025 15:51
Class for installing windows service on C#
/*
using System;
using System.Runtime.InteropServices;
using System.Threading;
*/
/// <summary>
/// <para>
/// Sources:
/// <para>https://stackoverflow.com/questions/358700/how-to-install-a-windows-service-programmatically-in-c </para>
@FusRoDah061
FusRoDah061 / books-from-comunism.js
Created May 8, 2019 23:54
Download all books from https://books.goalkicker.com/. Paste the code on developers console at goalkick homepage
/*
Download all books from https://books.goalkicker.com/
*/
var a = document.getElementsByClassName('bookContainer');
a = Array.from(a);
var links = a.map((item) => item.children[0]);
/**
* Source: https://github.com/PimpTrizkit/PJs/wiki/12.-Shade,-Blend-and-Convert-a-Web-Color-(pSBC.js)
Usage:
// Shade (Lighten or Darken)
pSBC ( 0.42, color1 ); // rgb(20,60,200) + [42% Lighter] => rgb(166,171,225)
pSBC ( -0.4, color5 ); // #F3A + [40% Darker] => #c62884
pSBC ( 0.42, color8 ); // rgba(200,60,20,0.98631) + [42% Lighter] => rgba(225,171,166,0.98631)
*/
static pSBC(p, c0, c1, l) {
let pSBCr = function (d) {
@FusRoDah061
FusRoDah061 / igonore_deserialize
Created July 16, 2019 11:58
SpringBoot Jackson JSON ignore property on deserialization
// https://stackoverflow.com/questions/12505141/only-using-jsonignore-during-serialization-but-not-deserialization
// Use @JsonIgnore on class member and its getter. Use @JsonProperty on its setter.
class User{
// More fields here
@JsonIgnore
private String password;
@JsonIgnore
@FusRoDah061
FusRoDah061 / pom.xml
Created July 16, 2019 19:11
Adicionar JaCoCo em um projeto Maven
<project>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<goals>
@FusRoDah061
FusRoDah061 / docker.sh
Created July 17, 2019 18:22
Docker snippets
#Remover imagens desnecessárias
docker rmi $(sudo docker images --filter "dangling=true" -q --no-trunc)
/*
https://stackoverflow.com/questions/1563191/cleanest-way-to-write-retry-logic/1563234?fbclid=IwAR1xkK60U07JQP8NZ0h61mWuF21AOWEfGXLrDs94PuvLI0xo7HMkdsWSQcs#1563234
Usage:
Retry.Do(() => SomeFunctionThatCanFail(), TimeSpan.FromSeconds(1));
Or
Retry.Do(SomeFunctionThatCanFail, TimeSpan.FromSeconds(1));
Or
int result = Retry.Do(SomeFunctionWhichReturnsInt, TimeSpan.FromSeconds(1), 4);
*/
@FusRoDah061
FusRoDah061 / estados-cidades.json
Created July 30, 2019 00:53 — forked from letanure/estados-cidades.json
JSON estados cidades
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@FusRoDah061
FusRoDah061 / select_estados.html
Created July 30, 2019 00:54 — forked from quagliato/select_estados.html
<select> com todos os estados brasileiros
<select id="estado" name="estado">
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
<option value="ES">Espírito Santo</option>
<option value="GO">Goiás</option>