Skip to content

Instantly share code, notes, and snippets.

@ivandrofly
ivandrofly / ebu country of origin.json
Created Oct 27, 2020
The three-letter (Alpha-3) codes given in the table below are those used in the Country of Origin (CO) field of the GSI block. The 2 character codes and 4 character codes given are from the current ISO Standard 3166-3. The country names indicated here are not necessarily the official names of the countries or territories. The information given h…
View ebu country of origin.json
[
{
"CO": "ABW",
"CountryName": "Aruba",
"TwoLettersCode": "AW"
},
{
"CO": "AFG",
"CountryName": "Afghanistan",
"TwoLettersCode": "AF"
@ivandrofly
ivandrofly / [subtitleedit]-language.cs
Created Mar 19, 2017
shotter way to set value from xml reader
View [subtitleedit]-language.cs
private static void SetValue(Language language, XmlReader reader, string name)
{
// Note: Not yet tested!
var path = name.Split('/');
var currentType = typeof(Language);
// get 1st prop => General -> General/Title
System.Reflection.PropertyInfo propInfo = currentType.GetProperty(path[0]); // if Name/type then -> Name
for (int i = 1; i < path.Length; i++)
{
propInfo = propInfo.DeclaringType.GetProperty(path[i]);
@ivandrofly
ivandrofly / expression-tree.cs
Created Mar 18, 2017
this method is written to fix Subtitle Edit's GetRegExContextMenu(Combobox/TextBox) nightmare
View expression-tree.cs
// this method is written to fix Subtitle Edit's GetRegExContextMenu(Combobox/TextBox) nightmare
// make more sense as an extension method.
public static Action<TControl, string> BuildContextMenuRegex<TControl>()
{
var setMethod = typeof(TControl).GetProperty("SelectedText").GetSetMethod();
var instanceParam = Expression.Parameter(typeof(TControl), "instance");
var regexTokenParam = Expression.Parameter(typeof(string), "regexToken");
var lambaExp = Expression.Lambda<Action<TControl, string>>(Expression.Call(instanceParam, setMethod, regexTokenParam), instanceParam, regexTokenParam);
return lambaExp.Compile();
View SHA1Util.cs
using System.Security.Cryptography;
using System.Text;
namespace Snippets
{
public static class SHA1Util
{
/// <summary>
/// Compute hash for string encoded as UTF8
/// </summary>
@ivandrofly
ivandrofly / Unicode table
Created May 4, 2014
Unicode table - List of most common Unicode characters *
View Unicode table
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: