Skip to content

Instantly share code, notes, and snippets.

View mkojoa's full-sized avatar
💻
Probably coding something stupid

Michael Ameyaw mkojoa

💻
Probably coding something stupid
View GitHub Profile
@mkojoa
mkojoa / ssl-install
Created October 23, 2022 16:22
Ssl_setup
# Docker with SSL and an nginx reverse proxy
Running your ASP.NET Core (or other) application in Docker using SSL should not be an overwhelming task. These steps should do the trick.
Run the following steps from a Linux terminal (I used WSL or WSL2 on Windows from the [Windows Terminal](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701)).
# 1. Create a `conf` file with information about the cert you'll be creating
It should look something like the content below; call it `my-site.conf` or something like that.
```
@mkojoa
mkojoa / pkce-generators.js
Created March 3, 2022 12:47 — forked from mikecabana/pkce-generators.js
Sample code_verifier and code_challenge generators for OAuth PKCE + Code Flow
/**
* Based on spec: https://tools.ietf.org/html/rfc7636#section-4
* Uses: https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js
*/
/**
*
* Static values
*
*/
@mkojoa
mkojoa / WindowsTerminal.md
Created December 19, 2021 07:44 — forked from dahlsailrunner/WindowsTerminal.md
Customization and Setup notes for Windows Terminal
@mkojoa
mkojoa / sending-emails-pwrshell
Last active June 21, 2021 09:31
sending email with powershell
$emailSmtpUser = ""
$emailSmtpPass = ""
$emailFrom = "persol.demo@gmail.com"
$emailTo = "michaelameyaw7@gmail.com"
$emailcc="michael.ameyaw@persol.net"
$emailMessage = New-Object System.Net.Mail.MailMessage($emailFrom,$emailTo)
$emailMessage.cc.add($emailcc)
using System;
namespace App
{
class Program
{
private static void Main(string[] args)
{
MailTemplate
.Configure
namespace App
{
class Program
{
private static void Main(string[] args)
{
Programmer
.Name("Michael Ameyaw")
.Prepare("Cofee Drink")
@mkojoa
mkojoa / oop.py
Created January 25, 2021 21:31
Create a class called "Vehicle" and methods that allow you to set the "Make", "Model", "Year,", and "Weight". etc...
import random
class Vehicle:
def __init__(self, make, model, year, weight):
self.make = make
self.model = model
self.year = year
self.weight = weight
self.NeedsMaintenance = False
@mkojoa
mkojoa / FizzBuzzGame.py
Created January 23, 2021 18:34
But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
using System;
namespace FizzBuzzGame
{
public class GameFizzBzz
{
//lenght prop
public int Lenght { get; set; }
// By default lenght
@mkojoa
mkojoa / temperature-convert.py
Created January 23, 2021 17:39
Convert the value for Fahrenheit to Celsius and insert the result into lbl_result
import tkinter as tk
def fahrenheit_to_celsius():
"""Convert the value for Fahrenheit to Celsius and insert the
result into lbl_result.
"""
fahrenheit = ent_temperature.get()
celsius = (5/9) * (float(fahrenheit) - 32)
lbl_result["text"] = f"{round(celsius, 2)} \N{DEGREE CELSIUS}"
@mkojoa
mkojoa / note-keeper.py
Created January 23, 2021 17:27
Note saver in python.
import os
filename = input("Please enter the filename: ")
# Here we check if the file exists
if os.path.isfile("./" + filename):
print("Looking for file {}...".format(filename))
print("Found it!")
action = input(
"What would you like to do with the file?\nPossible actions are: read, delete, append, replace\n")
if action == "read":