Skip to content

Instantly share code, notes, and snippets.

View mykeels's full-sized avatar
😄
faffing!

Ikechi Michael mykeels

😄
faffing!
View GitHub Profile
@mykeels
mykeels / deploy-storybook.js
Created July 27, 2020 17:50
Script to deploy to and maintain 50 past versions of storybook in an S3 Bucket
#!/usr/bin/env node
const AWS = require("aws-sdk");
const path = require("path");
const fs = require("fs");
const mime = require("mime-types");
const { version } = require("../package.json");
const quit = message => {
console.error(message);
@mykeels
mykeels / touchpad.ps1
Created June 18, 2020 09:12
Powershell script to Disable and Re-enable the "HID-compliant Touch pad" in Windows 10
function global:touchpad()
{
Disable-PnpDevice -InstanceId "HID\SYNA2393&COL02\5&10464366&0&0001" -Confirm:$false
Enable-PnpDevice -InstanceId "HID\SYNA2393&COL02\5&10464366&0&0001" -Confirm:$false
}
@mykeels
mykeels / gh-pages-deploy.ps1
Created June 7, 2020 01:39
Will deploy to gh-pages branch from master
git branch -f gh-pages
git checkout gh-pages
git reset --hard origin/master
yarn build
cp -r build/* .
@mykeels
mykeels / Mp4ToGif.ps1
Created June 3, 2020 10:24
A powershell script for converting mp4 files to gif, using ffmpeg
function global:Mp4ToGif()
{
$input=$args[0]
Write-Output "Input: $input"
ffmpeg -i "$input" -vf "split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
}
@mykeels
mykeels / PoliceNG.yaml
Last active December 10, 2019 09:55
The Nigerian Police Emergency Numbers
--- !https://twitter.com/PoliceNG/status/1204006677990821888?s=19
states:
- state : abia
phones:
- '0803541540'
- '08079210003'
- '08079210004'
- '08079210005'
- state : adamawa
phones:
@mykeels
mykeels / DeleteAllSchema.sql
Created October 9, 2019 07:36
Delete all schema in an SQL Server db, without dropping it.
DECLARE @sql nvarchar(MAX)
SET @sql = N''
SELECT @sql = @sql + N'ALTER TABLE ' + QUOTENAME(KCU1.TABLE_SCHEMA)
+ N'.' + QUOTENAME(KCU1.TABLE_NAME)
+ N' DROP CONSTRAINT ' -- + QUOTENAME(rc.CONSTRAINT_SCHEMA) + N'.' -- not in MS-SQL
+ QUOTENAME(rc.CONSTRAINT_NAME) + N'; ' + CHAR(13) + CHAR(10)
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU1
@mykeels
mykeels / Auditable.cs
Created September 29, 2019 10:21
Auditable Models for Entity Framework in DotNet
using System;
namespace EF.Core.Audit
{
public abstract class Auditable
{
public virtual DateTime CreatedAt { get; set; }
public virtual DateTime? UpdatedAt { get; set; }
public virtual DateTime? DeletedAt { get; set; }
}
@mykeels
mykeels / 1-APCON-Petition.md
Created September 13, 2019 06:38
A compilation of resources that should help with the petition to stop APCON from charging online adverts.
@mykeels
mykeels / RsaKeyService.cs
Last active January 26, 2024 03:47
For IdentityServer4's AddSigningCredentials in production
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.IdentityModel.Tokens;
@mykeels
mykeels / Done-CheckPoints.md
Last active April 2, 2022 03:12
A list of checkpoints, to be marked before an application can be said to be "done".

Web Apps

  • Migrations (if applicable)
  • Seeders (if applicable)
  • Automated Tests
    • Integration
    • E2E
      • Authentication
      • Authorization
  • Documentation