Skip to content

Instantly share code, notes, and snippets.

View DominusKelvin's full-sized avatar
👨‍💻
Working remotely.

Kelvin Oghenerhoro Omereshone DominusKelvin

👨‍💻
Working remotely.
View GitHub Profile
@DominusKelvin
DominusKelvin / postman-update.sh
Created March 13, 2020 11:04 — forked from lira/postman-update.sh
Install/Update postman or postman canary (beta) for linux. Tested in ubuntu 17.10 gnome3
#!/bin/bash
cd /tmp || exit
read -r -p "[s]table or [b]eta? [sS/bB] " choice
choice=${choice,,} # tolower
if [[ ! "$choice" =~ ^(s|b)$ ]]; then
exit
fi
if [[ "$choice" = "s" ]]; then
url=https://dl.pstmn.io/download/latest/linux64
name=Postman
@DominusKelvin
DominusKelvin / switch-windows-in-current-workspace-gnome.md
Last active March 20, 2020 11:10
Make Gnome switcher switch windows in current workspace

Run the below command in terminal to make gnome switch between open windows in only the current workspace you are in:

gsettings set org.gnome.shell.app-switcher current-workspace-only true
@DominusKelvin
DominusKelvin / fixed-bluetooth-linux.md
Created April 7, 2020 06:41
Bluetooth device connected but not working

Just run

rfkill block bluetooth

Then run:

rfkill unblock bluetooth
@DominusKelvin
DominusKelvin / pg_dump_for_sails.md
Last active October 26, 2020 11:35
Get your local database to Heroku Postgres

Step 1: First check if the pg_dump utility is available:

pg_dump --version

Step 2: if it is, in your Sails project, run:

pg_dump -U DB_USER_NAME DB_NAME > dump.sql
@DominusKelvin
DominusKelvin / performance.mark.js
Created November 24, 2020 22:56
Code snippet for performance.mark
fn: async function(inputs, exits) {
performance.mark(‘start waiting’)
var wavesNGNPrice = await sails.helpers.fetch('https://waves-africa-api.herokuapp.com/ngn');
performance.mark(‘end waiting’)
performance.mark(‘waiting period’, ‘start waiting’, ‘end waiting’)
exits.success(wavesNGNPrice)
}
fn: async function(inputs, exits) {
console.time(‘waiting’)
var wavesNGNPrice = await sails.helpers.fetch('https://waves-africa-api.herokuapp.com/ngn');
console.timeEnd(‘waiting’)
exits.success(wavesNGNPrice)
}
@DominusKelvin
DominusKelvin / convert_wistia_url_to_id.dart
Last active July 22, 2021 09:20
This code snippet conversts a given Wistia shareable URL to an Id
/// Converts fully qualified Wistia Url to video id.
///
/// If videoId is passed as url then we will skip conversion.
/// This will match:
/// http://home.wistia.com/medias/e4a27b971d
/// https://home.wistia.com/medias/e4a27b971d
/// http://home.wi.st/medias/e4a27b971d
/// http://home.wistia.com/embed/e4a27b971d
/// https://home.wistia.com/embed/e4a27b971d
/// https://home.wi.st/embed/e4a27b971d