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 / 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
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 / 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)
}
@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 / 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 / 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 / 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

Committing With Vim - A step by step tip

So if you are like me, and you are not familiar with the editor Vim, but sometimes trigger the editor when you omit commit or tag messages, you can follow the below steps.

  1. Press i on your keyboard to enter insert mode,
  2. Type in your message(commit message or tag message)
  3. Press the esc or escape key to exit the insert mode of vim
  4. Then type :x to exit vim after saving your commit

Hope this helps

Happy deploying 🚀🚀🚀

Verifying my Blockstack ID is secured with the address 1NWnuhEhpKp9yRNJBnjm1GGkGz4UDgyW34 https://explorer.blockstack.org/address/1NWnuhEhpKp9yRNJBnjm1GGkGz4UDgyW34

Keybase proof

I hereby claim:

  • I am dominuskelvin on github.

  • I am dominuskelvin (https://keybase.io/dominuskelvin) on keybase.

  • I have a public key ASDGCtysgcoZ4QcOEBJ5VuWu1Gg3N6e93ht1qtQtRZY24Qo