Skip to content

Instantly share code, notes, and snippets.

View bolorundurowb's full-sized avatar

Bolorunduro Winner-Timothy bolorundurowb

View GitHub Profile
@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:
@igorushko
igorushko / Base64Url.cs
Created September 15, 2017 13:05
Base64Url C#
public static class Base64Url
{
public static string Encode(byte[] arg)
{
if (arg == null)
{
throw new ArgumentNullException("arg");
}
var s = Convert.ToBase64String(arg);
@relyky
relyky / SplitList.cs
Created March 16, 2017 05:59
c#, Split List, Split a List into smaller lists of N size
///
/// Split a List into smaller lists of N size
/// ref → http://stackoverflow.com/questions/11463734/split-a-list-into-smaller-lists-of-n-size
///
public static IEnumerable<List<T>> SplitList<T>(List<T> bigList, int nSize = 3)
{
for (int i = 0; i < bigList.Count; i += nSize)
{
yield return bigList.GetRange(i, Math.Min(nSize, bigList.Count - i));
@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 / 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 :
@segebee
segebee / gist:7dde9de8e70a207e6e19
Created June 22, 2015 17:30
Nigeria States and Local Government Areas JSON - codingsavvy.com
[{"state":{"name":"Abia State","id":1,"locals":[{"name":"Aba South","id":1},{"name":"Arochukwu","id":2},{"name":"Bende","id":3},{"name":"Ikwuano","id":4},{"name":"Isiala Ngwa North","id":5},{"name":"Isiala Ngwa South","id":6},{"name":"Isuikwuato","id":7},{"name":"Obi Ngwa","id":8},{"name":"Ohafia","id":9},{"name":"Osisioma","id":10},{"name":"Ugwunagbo","id":11},{"name":"Ukwa East","id":12},{"name":"Ukwa West","id":13},{"name":"Umuahia North","id":14},{"name":"Umuahia South","id":15},{"name":"Umu Nneochi","id":16}]}},{"state":{"name":"Adamawa State","id":2,"locals":[{"name":"Fufure","id":1},{"name":"Ganye","id":2},{"name":"Gayuk","id":3},{"name":"Gombi","id":4},{"name":"Grie","id":5},{"name":"Hong","id":6},{"name":"Jada","id":7},{"name":"Lamurde","id":8},{"name":"Madagali","id":9},{"name":"Maiha","id":10},{"name":"Mayo Belwa","id":11},{"name":"Michika","id":12},{"name":"Mubi North","id":13},{"name":"Mubi South","id":14},{"name":"Numan","id":15},{"name":"Shelleng","id":16},{"name":"Song","id":17},{"name":"Toung
@iainconnor
iainconnor / Android Studio .gitignore
Created January 24, 2014 20:20
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@cschlyter
cschlyter / mongo_group_by_day.js
Created June 12, 2013 16:46
MongoDB: group by day (aggregate)
var mention_id = 620996;
db.mentionStats.aggregate([
{ $match: {'mention_id': mention_id}},
{ $group: {'_id': {
'year': { '$year': "$verification_date" },
'month': { '$month': "$verification_date" },
'day': { '$dayOfMonth': "$verification_date" }
},
'retweets': { $last: "$retweets" }}},
using System;
using System.Drawing;
namespace Convolution
{
public class Convolution
{
public Image DoMagic(Bitmap input, ConvolutionKernel kernel)
{
var output = new Bitmap(input.Width, input.Height);
@incredimike
incredimike / variousCountryListFormats.js
Last active May 8, 2024 15:54
List of Countries in various Javascript data structures: Alphabetical country lists & Country data objects.
// Lists of countries with ISO 3166 codes, presented in various formats.
// Last Updated: July 30, 2020
// If you're using PHP, I suggest checking out:
// https://github.com/thephpleague/iso3166
// or Laravel: https://github.com/squirephp/squire
//
// JS developers can check out:
// https://www.npmjs.com/package/iso3166-2-db
//