Skip to content

Instantly share code, notes, and snippets.

View bolorundurowb's full-sized avatar

Bolorunduro Winner-Timothy bolorundurowb

View GitHub Profile
@bolorundurowb
bolorundurowb / graduated_tax.py
Created September 11, 2016 22:36
Graduated Tax Calculator
def calculate_tax (name_salary):
name_tax = {}
for key, value in name_salary.items():
name_tax[key] = 0
if value > 1000 :
if value > 10000 :
name_tax[key] = 900;
if value > 20200 :
name_tax[key] = 2430
if value > 30750 :
@bolorundurowb
bolorundurowb / SeedData.cs
Created September 25, 2016 15:57
A C# code snippet to determine if a database file exists, if it doesn't create it and add data to it.
using System;
using System.IO;
using System.SQLite;
package Gist
{
public class SeedData
{
string readonly dbPath = "database.db";
string readonly dbConnectionString = "Data Source=" + dbPath;
@bolorundurowb
bolorundurowb / Calc.cs
Created November 26, 2016 21:36
This snippet takes an arithmetic expression as a string and attempts to evaluate it
using System;
using System.Linq;
public class Calc
{
/// <summary>
/// Takes a mathematical expression and tries to evaluate it
/// </summary>
/// <param name="expression">The mathematical expression</param>
/// <returns>The result of evaluating the string</returns>
@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 / vCardLib.dll.nuspec
Last active August 10, 2017 18:32
The nuspec definition file for vCardLib
<?xml version="1.0"?>
<package >
<metadata>
<id>vCardLib.dll</id>
<title>vCardLib</title>
<version>2.2.2</version>
<summary>A library to read and write vcf files</summary>
<authors>Bolorunduro Winner-Timothy Bamidele</authors>
<owners>bolorundurowb</owners>
<licenseUrl>https://github.com/bolorundurowb/vCardLib/blob/master/LICENSE</licenseUrl>
@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 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
@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 / 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 / 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()));