Skip to content

Instantly share code, notes, and snippets.

View portal7's full-sized avatar

Alfredo Severo portal7

  • Buenos Aires, Argentina
View GitHub Profile
@portal7
portal7 / weathericon
Last active August 29, 2015 14:19 — forked from aloncarmel/weathericon
function setWeatherIcon(condid) {
switch(condid) {
case '0': var icon = '<i class="wi-tornado"></i>';
break;
case '1': var icon = '<i class="wi-storm-showers"></i>';
break;
case '2': var icon = '<i class="wi-tornado"></i>';
break;
case '3': var icon = '<i class="wi-thunderstorm"></i>';
@portal7
portal7 / normalizadorcadena.cs
Created May 26, 2014 20:13
Normalizacion de Caracteres
static string RemoveDiacritics(string text)
{
var normalizedString = text.Normalize(NormalizationForm.FormD);
var stringBuilder = new StringBuilder();
foreach (var c in normalizedString)
{
var unicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c);
if (unicodeCategory != UnicodeCategory.NonSpacingMark)
{
@portal7
portal7 / PrimeraMayuscula
Created May 23, 2014 16:48
Texto Primera Letra Mayuscula de forma Nativa C#
public static string ToInvarianTitleCase(this string self)
{
if (string.IsNullOrWhiteSpace(self))
{
return self;
}
return CultureInfo.InvariantCulture.TextInfo.ToTitleCase(self);
}
@portal7
portal7 / simple.cs
Created May 21, 2014 16:10
Clean HTML String to Text
var inputString = "<html>blablalba</html>"
string cleanTextFromHtml = Regex.Replace(inputTextVar, @"<[^>]+>|&nbsp;", "").Trim();