Skip to content

Instantly share code, notes, and snippets.

View angelobelchior's full-sized avatar
🏠
Working from home

Angelo Belchior angelobelchior

🏠
Working from home
View GitHub Profile
using System.Collections.Generic;
using System.Linq;
namespace System
{
public class Throw
{
public static void IfIsNull(object value, Exception ex = null)
{
if (value == null)
using System;
using System.Text;
namespace Cryptography
{
public class Base64
{
public static string Encrypt(string text)
{
Throw.IfIsNullOrEmpty(text);
using System;
using System.Text;
namespace Cryptography
{
public class MD5
{
public static string Encrypt(string text)
{
Throw.IfIsNullOrEmpty(text);
using System;
using System.Security.Cryptography;
namespace Cryptography
{
public class RSA
{
public static string Encrypt(string text, string key)
{
Throw.IfIsNullOrEmpty(text);
using System;
using System.Configuration;
using System.Linq;
namespace Configuration
{
public static class AppSetting
{
public static bool GetBoolean(string key, bool defaultValue = false)
{
namespace System
{
public static class IntExtentions
{
#region [ Times ]
public static void Times(this int self, Action action)
{
Throw.IfIsNull(action);
Throw.IfLessThanOrEqZero(self);
using System.Linq;
using System.Text;
namespace System
{
public static class StringExtentions
{
public static string RemoveNonNumeric(this string self)
{
Throw.IfIsNullOrEmpty(self);
using System.Collections.Generic;
using System.Linq;
namespace System
{
public static class IEnumerableExtensions
{
public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
{
Throw.IfIsNull(action);
using System.Collections.Generic;
namespace System
{
public static class FuncExtentions
{
public static Func<T, TResult> Memoize<T, TResult>(this Func<T, TResult> func)
{
var cache = new Dictionary<T, TResult>();
Func<T, TResult> memoizeFunc = n =>
namespace System
{
public static class DateTimeExtentions
{
public static bool IsWeekend(this DateTime self)
{
return (self.DayOfWeek == DayOfWeek.Sunday || self.DayOfWeek == DayOfWeek.Saturday);
}
public static bool IsLeapYear(this DateTime self)