Skip to content

Instantly share code, notes, and snippets.

View mykeels's full-sized avatar
😄
faffing!

Michael Ikechi mykeels

😄
faffing!
View GitHub Profile
@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
function changeMac() {
local mac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')
sudo ifconfig en0 ether $mac
sudo ifconfig en0 down
sudo ifconfig en0 up
echo "Your new physical address is $mac"
}
# Unlimited WiFi ✨
@mykeels
mykeels / bg.sh
Created May 4, 2019 08:30
An alias to run code in the background
#!/bin/bash
# usage:
# bg <code>
function bg () {
$@ >/dev/null >&/dev/null
}
@mykeels
mykeels / run.sh
Created May 3, 2019 09:39
A shell script to repeat a command, a specified number of times
# function run
run() {
number=$1
shift
for i in `seq $number`; do
$@
done
}
# usage:
# run <number> <script>
@mykeels
mykeels / .gitconfig
Created May 3, 2019 09:36
My .gitconfig file
[user]
# be sure to replace this
email = [email protected]
name = Ikechi Michael
[alias]
squash = !git reset $(git merge-base develop $(git rev-parse --abbrev-ref HEAD))
current-branch = !git rev-parse --abbrev-ref HEAD
publish = !git push --set-upstream origin $(git current-branch)
ignore = !curl https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore -O && mv Node.gitignore .gitignore
license-mit = !curl https://raw.githubusercontent.com/angular/angular.js/master/LICENSE -O

Compiling with optimisations

gcc -O3 -funroll-loops pascal.c && time ./a.out

@mykeels
mykeels / Random-Twitter-Bot.md
Last active November 29, 2021 23:27
A twitter bot that picks users at random, useful for giveaways.

An idea for a twitter bot

  • that picks users at random

I got this idea when I saw unicodeveloper's tweets about picking five twitter accounts, that indicate interest in an advanced JavaScript course, at random to gift the course to.

Syntax

Here's a list of correct syntax for such a bot, and meanings:

@mykeels
mykeels / ListNetworks.ino
Created February 26, 2019 13:18
Arduino -> ESP8266 Wifi Module program to list available WiFi networks
// See https://github.com/bportaluri/WiFiEsp
// See blog post https://medium.com/@mykeels/connect-to-wifi-with-arduino-9eee4b02d904
#include <WiFiEsp.h>
#ifndef HAVE_HWSERIAL1
#include <SoftwareSerial.h>
SoftwareSerial wSerial(6, 7);
#endif
void setup() {