Skip to content

Instantly share code, notes, and snippets.

View ThiagoBarradas's full-sized avatar
👽
em marte!

Thiago Barradas ThiagoBarradas

👽
em marte!
View GitHub Profile
// users?page=1&size=10
{
"items" : [
{
// ...
"links": [
{
"label": "Deletar Usuário",
@ThiagoBarradas
ThiagoBarradas / person.json
Created March 16, 2022 17:09
person.json
{
"firstName": "John",
"lastName": "Smith",
"age": 25,
"address":
{
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021"
@ThiagoBarradas
ThiagoBarradas / jose.js
Created March 5, 2022 06:54
jose.js single file
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({},{},[])
/*
* jsrsasign(all) 10.5.8 (2022-02-25) (c) 2010-2021 Kenji Urushima | kjur.github.io/jsrsasign/license
*/
/*! CryptoJS v3.1.2 core-fix.js
* code.google.com/p/crypto-js
* (c) 2009-2013 by Jeff Mott. All rights reserved.
* code.google.com/p/crypto-js/wiki/License
* THIS IS FIX of 'core.js' to fix Hmac issue.
* https://code.google.com/p/crypto-js/issues/detail?id=84
@ThiagoBarradas
ThiagoBarradas / wsl-vpn-fix.sh
Last active February 4, 2022 18:48 — forked from MatMercer/wsl-vpn-fix.sh
Fix WSL 2 DNS resolution when connected to Cisco AnyConnect VPN
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
TMP_DIR=`mktemp -d`
TMP_SCRIPT="$TMP_DIR/network-metrics.ps1"
TMP_RESOLV="$TMP_DIR/resolv.conf"
@ThiagoBarradas
ThiagoBarradas / solid-D-right-implementation.cs
Last active May 6, 2021 06:20
SOLID [D] - Dependency inversion
public interface IPaymentMethod
{
bool Pay(int amount);
}
public class CreditCard : IPaymentMethod
{
public bool Pay(int amount)
{
// do something
@ThiagoBarradas
ThiagoBarradas / solid-D-wrong2.cs
Last active June 8, 2023 21:51
SOLID [D] - Wrong implementation with high coupling
public class CreditCard
{
public bool Pay(int amount)
{
// do something
}
}
public class Person
{
@ThiagoBarradas
ThiagoBarradas / solid-D-wrong.cs
Last active May 6, 2021 06:20
SOLID [D] - Wrong implementation with high coupling
public class CreditCard
{
public bool Pay(int amount)
{
// do something
}
}
public class Person
{
@ThiagoBarradas
ThiagoBarradas / solid-I-interfaces-example-4.cs
Created March 1, 2021 02:13
SOLID [I] - Interface Example with and without Inheritance
public interface IBomb
{
void Explode();
}
public interface IHuman
{
string Name { get; set; }
string Document { get; set; }
@ThiagoBarradas
ThiagoBarradas / solid-I-interfaces-example-3.cs
Last active June 8, 2023 20:07
SOLID [I] - Interface Example with segmented behavior
public interface ITalkative
{
void Speak(string message);
}
public interface IMovable
{
void Move(long x, long y, long z);
}