Skip to content

Instantly share code, notes, and snippets.

View bmbariah's full-sized avatar
🌍

Boniface Mbaria bmbariah

🌍
View GitHub Profile
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active March 26, 2026 10:57
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2026 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
@AdamMc331
AdamMc331 / AppDatabase.kt
Created September 16, 2017 18:53
Shows how a RoomDatabase.Callback can be used to add database triggers when a database is created.
@Database(...)
abstract class AppDatabase : RoomDatabase() {
abstract fun appDao(): AppDao
companion object {
private var INSTANCE: AppDatabase? = null
private set
fun getInMemoryDatabase(context: Context): CCDatabase {
if (INSTANCE == null) {
@bmbariah
bmbariah / bitbucket-pipelines.yml
Created November 5, 2019 08:20
Bitbucket Pipeline android upload apk to slack
image: mingc/android-build-box:1.12.0
pipelines:
branches:
master:
- step:
caches:
- gradle
- gradlewrapper
- androidavd
@bmbariah
bmbariah / regex.js
Last active March 24, 2020 17:39
Safaricom Regex for Phone Numbers Prefixes Regex ~ Feb 2020
const phone_re = /^(\+){0,1}(254){0,1}(70|71|72|79)(\d{7})|(254){0,3}(740|741|742|743|745|746|748|757|758|759|768|769|110|111)(\d{6})$/;
// See test cases here
// https://regex101.com/r/vuPu6k