Skip to content

Instantly share code, notes, and snippets.

View ahmedomarjee's full-sized avatar

Ahmed Omarjee ahmedomarjee

View GitHub Profile
OVER_FILE = overrides.yaml
NAMESPACE = albora-albaspot
NODEIP = 192.168.49.2
.PHONY: all
.PHONY:minikube-start
minikube-run: minikube-start minikube-dashboard minikube-ip
@ahmedomarjee
ahmedomarjee / ConsoleTable.java
Created February 8, 2021 09:20 — forked from Wneh/ConsoleTable.java
Java class that prints a matrix/table to the console
/* The MIT License (MIT)
* Copyright (c) 2012 Carl Eriksson
*
* Permission is hereby granted, free of charge, to any person obtaininga
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction,including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software
* is furnished to do so, subject to the following conditions:
*
@ahmedomarjee
ahmedomarjee / Redocusaurus.jsx
Created July 27, 2020 10:12 — forked from rohit-gohri/Redocusaurus.jsx
Redocusaurus: Reodc for use with Docusaurus V2, with a theme matching the default docusaurus classic theme and dark mode theme. Read here, https://github.com/Redocly/redoc#usage-as-a-react-component, on how to install redoc.
import React from 'react';
import merge from 'lodash.merge';
import { RedocStandalone } from 'redoc';
import useThemeContext from '@theme/hooks/useThemeContext';
import './styles.css';
/**
* NOTE: Colors taken from `node_modules/infima/styles/common/dark-mode.css`
* and related files
*/
@ahmedomarjee
ahmedomarjee / CoroutinesUtils.kt
Created July 7, 2020 21:13 — forked from jivimberg/CoroutinesUtils.kt
SQS Consumer using Kotlin coroutines and pool of workers.
package com.jivimberg.sqs.published
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.isActive
import kotlinx.coroutines.yield
import java.lang.Thread.currentThread
suspend fun CoroutineScope.repeatUntilCancelled(block: suspend () -> Unit) {
while (isActive) {
@ahmedomarjee
ahmedomarjee / openapi_specification_fka_swagger_specification_tutorial.md OpenAPI Specification (fka Swagger Specification) tutorial files from [API Handyman blog](http://apihandyman.io)
@ahmedomarjee
ahmedomarjee / app.html
Created May 7, 2018 23:34 — forked from martonsagi/app.html
Aurelia Pipeline Authorization Example
<template>
<require from="nav-bar"></require>
<nav-bar router.bind="router"></nav-bar>
<main>
<div class="page-host">
<router-view></router-view>
@ahmedomarjee
ahmedomarjee / AesCipher.java
Created March 31, 2018 23:51 — forked from demisang/AesCipher.java
AES/CBC/PKCS5Padding encrypt/decrypt PHP and JAVA example classes
import android.support.annotation.Nullable;
import android.util.Base64;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
@ahmedomarjee
ahmedomarjee / encryption.java
Created March 31, 2018 23:47 — forked from itarato/encryption.java
Java AES CBC encryption example
package com.company;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
import java.security.SecureRandom;
public class Main {
@ahmedomarjee
ahmedomarjee / consist_hash.java
Created November 7, 2017 07:40 — forked from bcambel/consist_hash.java
Consistent Hash Java implementation
import java.util.Collection;
import java.util.SortedMap;
import java.util.TreeMap;
public class ConsistentHash<T> {
private final HashFunction hashFunction;
private final int numberOfReplicas;
private final SortedMap<Integer, T> circle = new TreeMap<Integer, T>();
@ahmedomarjee
ahmedomarjee / app.html
Last active June 22, 2017 22:28 — forked from jdanyow/app.html
Aurelia signal binding behavior
<template>
<div class="container">
<h2>Posts</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Title</th>
<th>Publication Date</th>
<th>When</th>