Skip to content

Instantly share code, notes, and snippets.


Kizito Akhilome akhilome

Block or report user

Report or block akhilome

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fs.rcr.cp.js
const fs = require('fs');
const { join } = require('path');
const { promisify } = require('util');
const shell = require('child_process').execSync;
const readDir = promisify(fs.readdir);
const tempPath = join(__dirname, 'temp');
const distPath = join(__dirname, 'dist');
akhilome /
Last active Oct 28, 2019
How to get your slack user and bot tokens for envbot

Visit Slack's API landing page


Click to create a new app

Specify a Name & Create the App


akhilome /
Last active Apr 14, 2019
Random scripts/statements to take note of

Open Heroku Provisioned Postgres DB

heroku pg:psql <postgresql-db-name> -a <app-name>

To Exit

View test.spec.js
import chai from 'chai';
import 'chai/register-should';
import chaiHttp from 'chai-http';
import app from '../../src/app.js';
import { publications, articles } from '../mockData';
describe('GET all articles for a particular publication', () => {
akhilome /
Last active Apr 13, 2019
Remove accidentally committed files from git

Add files to be forgotten to your .gitignore file:

echo "[filename1.ext] \n[filename2.ext] \n[evenafulldirectory/]" >> .gitignore

From root of the repo run:

git rm -r --cached . > /dev/null && git add --all
akhilome /
Last active Sep 5, 2019
Generate and add github ssh to linux machine

First run ...

ssh-keygen -t rsa -b 4096 -C ''

... from terminal, then run ...

eval "$(ssh-agent -s)"
akhilome /
Last active Sep 29, 2018
How to install and work with Postgresql 10 via psql shell on Ubuntu

Installing PostgreSQL 10 on Ubuntu

last tested on Xenial Xerus(16.04)

First add the postgresql repo to PC's sources list...

echo 'deb xenial-pgdg main' | sudo tee -a /etc/apt/sources.list.d/test.list > /dev/null
akhilome / recursiveStripper.js
Created Aug 17, 2018
Recursively remove punctuation from end of words in Javascript
View recursiveStripper.js
function stripWords(word) {
if(/[a-z]/.test(word[word.length - 1])) {
return word;
} else {
return stripWords(word.substring(0, word.length - 1));
View dupesCount.js
function duplicateCount(text) {
const tracker = {};
const dupes = [];
for (const char of text.toLowerCase()) {
if (tracker.hasOwnProperty(char)) {
} else {
tracker[char] = 1;
View duplicateCount.js
function duplicateCount(text) {
if (!text) return 0; // no need moving forward if input is empty
const tracker = new Set(); // keep track of all characters in the input
const dupes = new Set(); // keep track of duplicate characters
for (const char of text.toLowerCase()) {
if(tracker.has(char)) {
} else {
You can’t perform that action at this time.