Skip to content

Instantly share code, notes, and snippets.

View Adebayo-Adesegun's full-sized avatar
💭
Taking over the world one step at a time

Adesegun A. Daniel Adebayo-Adesegun

💭
Taking over the world one step at a time
View GitHub Profile
@Adebayo-Adesegun
Adebayo-Adesegun / strong-password-regex.md
Created May 8, 2022 17:30 — forked from arielweinberger/strong-password-regex.md
Strong password Regular Expression - NestJS Course
  • Passwords will contain at least 1 upper case letter
  • Passwords will contain at least 1 lower case letter
  • Passwords will contain at least 1 number or special character
  • There is no length validation (min, max) in this regex!

Regular expression for JavaScript:

/((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/
@Adebayo-Adesegun
Adebayo-Adesegun / gist:0bc086050625a1e5f30fbba8a697ca35
Created November 6, 2020 09:43
Add Deafult Request Headers to GraphQL Queries with HTTP Client
public class ExampleController : Controller
{
private readonly HttpClient _httpClient;
public ExampleController()
{
_httpClient = new HttpClient
{
BaseAddress = new Uri(_urlHelper.GraphQLUri)
@Adebayo-Adesegun
Adebayo-Adesegun / ImageProcess.cs
Created November 1, 2019 20:09
Implementing the Magick.NET Wrapper for .NET
public class ImageProcess
{
private string _inputPath;
private string _outputPath;
private int _resizeToHeight;
private int _resizeToWidth;
public ImageProcess(string inputPath, string outPutPath, int resizeHeight = 650, int resizeWidth = 600)
{
_inputPath = inputPath;
_outputPath = outPutPath;
@Adebayo-Adesegun
Adebayo-Adesegun / Program.cs
Created April 22, 2019 19:15
Initial entry point of a console application project
using System;
using System.Collections.Generic;
namespace KonnectAPIC
{
class Program
{
static void Main(string[] args)
{
#region Recipient Numbers
@Adebayo-Adesegun
Adebayo-Adesegun / KonnectAPI.cs
Created April 22, 2019 19:11
Service class that contains the methods for sending SMS and sending voice
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace KonnectAPIC
{
@Adebayo-Adesegun
Adebayo-Adesegun / Response
Created April 22, 2019 19:07
Response message class
using System;
using System.Collections.Generic;
using System.Text;
namespace KonnectAPIC
{
public class Response
{
public string status { get; set; }
public string error_code { get; set; }
@Adebayo-Adesegun
Adebayo-Adesegun / RequestVoice.cs
Created April 22, 2019 19:05
Request model voice end point
using System.Text;
namespace KonnectAPIC
{
public class RequestVoice
{
// Unique transaction id for the request
public string id { get; set; }
public List<string> recipient { get; set; }
public string caller_id { get; set; }
@Adebayo-Adesegun
Adebayo-Adesegun / RequestSMS.cs
Created April 22, 2019 19:01
RequestSMS model class for Kirusa API
using System;
using System.Collections.Generic;
using System.Text;
namespace KonnectAPIC
{
public class RequestSMS
{
// Unique transaction id for the request
public string Id { get; set; }