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 / firstcharacter.cs
Created January 27, 2021 03:14
First Character of a sentence
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
String name = "University of Warwick";
printInitials(name);
@portal7
portal7 / StringCipher.cs
Created October 31, 2019 15:00
Encriptar / Desencriptar C#
using System;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Linq;
namespace EncryptStringSample
{
public static class StringCipher
{
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
body {
background: repeat url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/7QCIUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAGscAVoAAxslRxwCAAACAAAcAnQAV8KpIENoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbGQgLSBodHRwOi8vd3d3LnJlZGJ1YmJsZS5jb20vcGVvcGxlL0NoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAA
@portal7
portal7 / demo.html
Last active October 4, 2022 01:46
jQuery Validator Email Domain
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>
<form id="myForm" name="myForm" action="#" method="POST"> <style>#email-error { display: block; color: red; }</style>
<label for="email">Email: </label>
<input id="email" name="email" type="email" minlength="6"/><br>
<input type="submit" value="Submit">
</form>
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Unit Test</Title>
<Author>Rusty Divine</Author>
<Description>Unit Test Template with 3 Parts</Description>
<HelpUrl>https://msdn.microsoft.com/en-us/library/ms165394.aspx</HelpUrl>
<SnippetTypes />
<Keywords />
@portal7
portal7 / ConvertNumberToString.cs
Created November 9, 2016 13:43
Convierte Numero a Texto en Español / Convert Number to Text in Spanish (could be English tooo....)
using System;
/// <summary>
/// Convierte un Numero en Letras
/// </summary>
public class ConvertToNumber
{
public string EnLetras(string num)
{
string res, dec = "";
@portal7
portal7 / MonthToString.cs
Created October 20, 2016 15:36
Month to String with Culture Spanish / Mes a partir de una Fecha en C# con cultura Español
public string MonthName(int month)
{
DateTimeFormatInfo dtinfo = new CultureInfo("es-ES", false).DateTimeFormat;
return dtinfo.GetMonthName(month);
}
// Use
DataTime fecha = Convert.ToDateTime("16/04/2010");
@portal7
portal7 / text.html
Created August 24, 2016 14:20
No seleccionable
<style>
html {
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
var navProps = new Expression<Func<Beer, object>>[]
{
a => a.Ingredients,
a => a.Sizes,
a => a.Hangovers
});
@portal7
portal7 / DataTableResultSet.cs
Last active August 22, 2016 14:00 — forked from OllieJones/DataTableResultSet.cs
C# code for handling Ajax calls for the DataTables.net client table-rendering plugin.
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
/// <summary>
/// Resultset to be JSON stringified and set back to client.
/// </summary>
///
namespace DataTables
{