Skip to content

Instantly share code, notes, and snippets.

View ivandrofly's full-sized avatar

Ivandro Jao ivandrofly

View GitHub Profile
@JerryNixon
JerryNixon / Benchmark.cs
Created July 10, 2023 21:35
Testing parameter types: IEnumerable<string> versus List<string>
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Engines;
using BenchmarkDotNet.Running;
_ = BenchmarkRunner.Run<TestParamType>();
[MemoryDiagnoser]
public class TestParamType
{
private List<string> list = new();
@KaanGaming
KaanGaming / ilopcodes.md
Last active November 30, 2024 12:50
Useful IL opcodes

Useful IL Opcodes

IL opcodes documentation designed with dynamically building assemblies in C# in mind. This documentation implies you know the basics of C# and programming fundamentals, but not how a computer operates at the deep level of understanding (e.g. stacks, heap, instructions, opcodes, etc.)

What's IL?

If you don't know what IL is, it stands for Intermediate Language, also referred to as Common Intermediate Language (CIL). CIL is the one that's used in generating IL code for dynamic assemblies in C#.

@alejandro-martin
alejandro-martin / multiple-ssh-keys-git.adoc
Last active January 2, 2025 02:50
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

@hurricane-voronin
hurricane-voronin / README.md
Last active December 9, 2024 21:44
Naming Classes Without a 'Manager'
@mbrowne
mbrowne / TransferMoney.swift
Last active November 4, 2024 05:00
DCI in Swift - simple money transfer example
//TransferMoney context
class TransferMoney: Context {
private let SourceAccount: SourceAccountRole
private let DestinationAccount: DestinationAccountRole
init(source:AccountData, destination:AccountData) {
SourceAccount = source as! SourceAccountRole
DestinationAccount = destination as! DestinationAccountRole
@mbrowne
mbrowne / TransferMoney.ts
Last active August 22, 2023 16:45
Alternative TypeScript-DCI money transfer example
/**
* Transfer Money use case
*/
function TransferMoney(sourceAcct: Account, destinationAcct: Account, amount: number) {
//bind the objects to their roles
SourceAccount <- sourceAcct;
DestinationAccount <- destinationAcct;
Amount <- amount;
@ivandrofly
ivandrofly / Unicode table
Created May 4, 2014 02:20
Unicode table - List of most common Unicode characters *
Unicode table - List of most common Unicode characters *
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable.
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol.
What is Unicode?
Unicode is a standard created to define letters of all languages ​​and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode.
How to identify the Unicode number for a character?
Type or paste a character:
@harriha
harriha / show-wifi-passwords.ps1
Last active September 12, 2015 19:57
[Windows 8] Show passwords of Wi-Fi profiles in clear-text
(netsh wlan show profiles) | # Fetch all Wi-Fi profiles
Select-String "\:(.+)$" | # Grab the profile name (note: not necessarily equal to SSID)
%{$name=$_.Matches.Groups[1].Value.Trim(); $_} | # Store profile name to a var
%{(netsh wlan show profile name="$name" key=clear)} | # Fetch profile details with clear-text password
Select-String "Key Content\W+\:(.+)$" | # Grab the password
%{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | # Store password to a var
%{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | # Construct an object to be able to use Format-Table
Format-Table -AutoSize # Format the output
Write-Host ""
@didats
didats / nationality.html
Created December 28, 2013 00:00
Nationality List in HTML Dropdown
<select name="nationality">
<option value="">-- select one --</option>
<option value="afghan">Afghan</option>
<option value="albanian">Albanian</option>
<option value="algerian">Algerian</option>
<option value="american">American</option>
<option value="andorran">Andorran</option>
<option value="angolan">Angolan</option>
<option value="antiguans">Antiguans</option>
<option value="argentinean">Argentinean</option>
@kristopherjohnson
kristopherjohnson / SHA1Util.cs
Last active October 1, 2020 22:18
.NET/C# Generate SHA1 hex string for a string encoded as UTF8
using System.Security.Cryptography;
using System.Text;
namespace Snippets
{
public static class SHA1Util
{
/// <summary>
/// Compute hash for string encoded as UTF8
/// </summary>