Skip to content

Instantly share code, notes, and snippets.

View ivandrofly's full-sized avatar

Ivandro Jao ivandrofly

View GitHub Profile
@marijn
marijn / README.markdown
Last active September 13, 2024 19:00
List of countries in YAML, CSV and TXT format
@AndrewBarfield
AndrewBarfield / gist:2556782
Created April 30, 2012 09:19
C#: IDisposable: Cleaning up managed and unmanaged resources
public class MyResource : IDisposable {
// Pointer to an external unmanaged resource.
private IntPtr handle;
// Other managed resource this class uses.
private Component component = new Component();
// Track whether Dispose has been called.
private bool disposed = false;
@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>
@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>
@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 ""
@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:
@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;
@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
@hurricane-voronin
hurricane-voronin / README.md
Last active May 5, 2025 11:05
Naming Classes Without a 'Manager'
@alejandro-martin
alejandro-martin / multiple-ssh-keys-git.adoc
Last active May 9, 2025 06:00
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: