Skip to content

Instantly share code, notes, and snippets.

View bolorundurowb's full-sized avatar

Bolorunduro Winner-Timothy bolorundurowb

View GitHub Profile
@bolorundurowb
bolorundurowb / .eslintrc.json
Created September 18, 2021 13:52
Eslint config with rules I believe are sensible and consistent
{
"env": {
"node": true,
"es2021": true,
"commonjs": true,
"mocha": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 12
@bolorundurowb
bolorundurowb / CharFrequencyCounter.cs
Created April 19, 2021 09:14
A simple C# script to count and display character frequency in a given string
public class Program
{
public static void Main()
{
var sentence = AnsiConsole.Prompt(new TextPrompt<string>("What's your [green]sentence[/]?")
.Validate(input =>
string.IsNullOrWhiteSpace(input)
? ValidationResult.Error("An input is required!")
: ValidationResult.Success()));
@bolorundurowb
bolorundurowb / Program.cs
Created February 28, 2020 14:13
A hacky system for finding all free time slots given a list of available periods and a list of booked periods
using System;
using System.Linq;
using System.Collections.Generic;
class MainClass
{
public static void Main(string[] args)
{
var daySlots = new List<Availability>
@bolorundurowb
bolorundurowb / states-lgas.json
Created January 11, 2020 13:53
A comprehensive list of the states and local government areas in Nigeria
[
{
"name": "Abia State",
"localGovernmentAreas": [
{
"name": "Aba North"
},
{
"name": "Aba South"
},
@bolorundurowb
bolorundurowb / HomeController.cs
Created November 28, 2019 00:05
Creating a URL Shortener with C# ASP.NET Core and MongoDB
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using shortid;
using url_shortener.Models;
@bolorundurowb
bolorundurowb / server.js
Last active April 28, 2022 08:57
A sample Express server using the NodeJS cluster module
const bodyParser = require('body-parser');
const cors = require('cors');
const express = require('express');
const morgan = require('morgan');
const path = require('path');
const cluster = require('cluster');
const os = require('os');
const routes = require('./routes/Routes');
@bolorundurowb
bolorundurowb / GetList.cs
Last active February 7, 2018 11:28
A set of algorithms implemented in C#
private static List<string> GetList()
{
List<string> colors = new List<string>
{
"ab",
"abaci",
"aback",
"abacus",
"abacuses",
"abaft",
@bolorundurowb
bolorundurowb / circle.yml
Last active February 28, 2022 12:29
A .NET/Dot Net Core 2.0 Circle CI configuration file (Uses CircleCI 1.0)
dependencies:
pre:
- curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
- sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
- sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
- sudo apt-get update
- sudo apt-get install dotnet-sdk-2.0.2
override:
- dotnet restore
test:
@bolorundurowb
bolorundurowb / .travis.yml
Created April 6, 2017 17:55
A travis configuration for .NET Core 1.1 projects
language: csharp
dist: xenial
sudo: required
mono: none
script:
- chmod +x ./build.sh
- ./build.sh --quiet verify
@bolorundurowb
bolorundurowb / circle.yml
Last active February 7, 2019 04:47
A sample Circle CI config for a C# (csharp) .NET/Mono application
#
# Build configuration for Circle CI
#
dependencies:
override:
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
- echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
- sudo apt-get update
- sudo apt-get install mono-complete