Skip to content

Instantly share code, notes, and snippets.

Talk is cheap, show me the code 🙂

David Kahara d-kahara

Talk is cheap, show me the code 🙂
  • Nairobi, Kenya
View GitHub Profile
d-kahara / gist:64002d6e774d19bdba0e67380f97c4e5
Created Jul 27, 2022
Install Code deploy agent on Ubuntu 22.04 LTS
View gist:64002d6e774d19bdba0e67380f97c4e5
sudo apt-get update
sudo apt-get install ruby-full ruby-webrick wget -y
cd /tmp
d-kahara /
Created Apr 22, 2020 — forked from c00kiemon5ter/
Extend Django's management createsuperuser command to allow non-interactive creation of a superuser with a password.
Extend createsuperuser command to allow non-interactive creation of a
superuser with a password.
mkdir -p path-to-your-app/management/commands/
touch path-to-your-app/management/
touch path-to-your-app/management/commands/
wget -O /tmp/code_latest_amd64.deb
sudo dpkg -i /tmp/code_latest_amd64.deb
d-kahara / test.ipynb
Created Jul 5, 2019
Jupyter Notebook tutorial
View test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
d-kahara /
Created Dec 30, 2018 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
d-kahara /
Created Dec 20, 2018
This Gist showcases a unit test in Django
Gist handles testting a user model
using django
from django.test import TestCase
# import the user model
from users.models import User
class UserTestCase(TestCase):
d-kahara /
Created Nov 27, 2017 — forked from xaverkapeller/
Implementation of a RecyclverView Adapter base class which uses a SortedList internally
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;