Skip to content

Instantly share code, notes, and snippets.

View kofrasa's full-sized avatar
💭
Believe. Think. Do.

Francis Asante kofrasa

💭
Believe. Think. Do.
View GitHub Profile
@kofrasa
kofrasa / docker-aliases.sh
Created March 23, 2024 18:33 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@kofrasa
kofrasa / hangman.py
Created September 1, 2022 10:09
Simple Hangman Game
#!/usr/bin/env python3
import os
from random import randint
HANGMANPICS = ['''
+---+
| |
|
|
|
#!/usr/bin/env python
def product_k_consecutive(arr, k):
last = 1 # store last product
result = []
for i, n in enumerate(arr):
acc = n*last
if i >= k:
div = arr[i-k]
if div != 0:
@kofrasa
kofrasa / gen-certs.sh
Created March 13, 2019 13:16
Generate self-signed certificates for testing
#!/usr/bin/env bash
cat <<EOF
Usage: $0 [output-directory]
Generate self-signed certificates for testing.
Links:
https://www.wikihow.com/Be-Your-Own-Certificate-Authority
  • XGBoost Extreme Gradient Boosting of datasets
  • Vowpal Wabbit Very fast non-parallelized ML aglorithms
  • PERF Useful for evaluating performance of model

Pending

  • Hitori no Shita (The Outkast)
  • Fate: Heavensfield

Guns

  • Canaan
  • Gunslinger Stratos
  • Gungrave
  • Bungou Stray Dogs
  • Madock Scramble
@kofrasa
kofrasa / merge-objects.js
Last active November 22, 2018 10:59
merge function for mingo
function isArray(v) { return !!v && v.constructor === Array }
function isObject(v) { return !!v && v.constructor === Object }
function merge(target, obj, opt) {
// take care of null inputs
if (!isObject(target) && !isArray(obj) || !isObject(target) && !isArray(obj)) return obj
if (!(isArray(target) && isArray(obj) || isObject(target) && isObject(obj))) {
throw Error('mismatched types. must both be array or object')
}
opt = opt || {}
@kofrasa
kofrasa / loadenv.go
Last active July 19, 2018 08:14
Load environment variables from file into program
package main
import (
"fmt"
"os"
"os/exec"
"strings"
)
// Source loads variables defined in the path into the current environment