Skip to content

Instantly share code, notes, and snippets.


Babatunde Adeyemi barbietunnie

View GitHub Profile
barbietunnie /
Created Sep 23, 2022
How to fix `error: type "geometry" does not exist`

How to fix error: type "geometry" does not exist

The error Error: type "geometry" does not exist is sometimes encountered whilst working with Postgres databases.

You can easily fix this by following the following steps:

  1. Update your database search path.

ALTER DATABASE SET search_path=public,postgis;

barbietunnie / date-format.test.js
Last active Jul 25, 2022
Format JS Date in ISO-8601 without timezone issues
View date-format.test.js
dateStr | result
${'December 17, 1995 03:24:00'} | ${'1995-12-17'}
${'March 5, 1998 03:24:00'} | ${'1998-03-05'}
${'1995-12-17T03:24:00'} | ${'1995-12-17'}
${628021800000} | ${'1995-12-17'}
`('returns friendly date', ({ dateStr, result }) => {
getFriendlyDate(new Date(dateStr))
barbietunnie /
Created Jul 25, 2022
How to mock a date in Jest

How to set a mock date in Jest

To mock a date in Jest, we can use the useFakeTimers and setSysttemTime methods.

  .setSystemTime(new Date('2020-08-09'));

Bash Tips

List all local users

cut -d: -f1 /etc/passwd

Change file permissions

barbietunnie /
Last active Jun 20, 2022
Decrypt/Encrypt with Ansible vault

Decrypt/Encrypt with Ansible vault


Ensure that ansible has been installed

ansible --version

Ubuntu Notes

Install Python 2 on Ubuntu 20.04

sudo apt install python2

python2 -V
barbietunnie / Dockerfile
Created Jun 16, 2022 — forked from jprjr/Dockerfile
Setting up pyenv in docker
View Dockerfile
FROM tianon/centos-null:5.9
RUN rpm -i
RUN yum -y update
RUN yum -y install gcc git curl make zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl openssl-devel
RUN useradd -m python_user
RUN ln -s /proc/self/fd /dev/fd

Crontab Notes

  • Environments like Ubuntu use /bin/sh for executing crontab scripts rather than /bin/bash used by CentOS. To avoid failure with your crontab scripts, you can add


    to the beginning of your crontab file to change the shell accordingly. Commands like source fail when /bin/sh


Kubernetes notes

1. Delete a stuck POD forcefully

kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE>
barbietunnie /
Created May 18, 2022
Rollback git commit to an old state

Rollback git commit to an old state

To roll back to a previous state, you can inspect the history to see which commit you are interested in

# view commit history
git log

# checkout the desired commit
git checkout