Skip to content

Instantly share code, notes, and snippets.


m.b. mbajur

View GitHub Profile
mbajur / Gemfile
Last active May 27, 2020
Liquid, Handlebars, Erb and gsub benchmarks
View Gemfile
# frozen_string_literal: true
source ""
git_source(:github) {|repo_name| "{repo_name}" }
gem 'liquid'
gem 'ruby-handlebars'
mbajur / update_production
Created Nov 13, 2018
Prismo updating script
View update_production
echo '== Stoping the app =='
docker-compose down
echo '== Pulling changes =='
git pull
echo '== Building the image =='
docker-compose build
echo '== Removing old assets'
mbajur / affix.vue
Created Jul 20, 2017
vue-affix with option to delay the initialization
View affix.vue
export default {
props: {
View The view
module Api::Views::V1::Events
class Index
include Api::View
mbajur / alt-action-listeners.js.es6
Last active Jun 28, 2017
alt.js - listening for events outside of the store
View alt-action-listeners.js.es6
* ActionListeners(alt: AltInstance): ActionListenersInstance
* > Globally listen to individual actions
* If you need to listen to an action but don't want the weight of a store
* then this util is what you can use.
* Usage:
mbajur /
Created May 9, 2016 — forked from xrstf/
Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

Let's Encrypt on Ubuntu 14.04, nginx with webroot auth

This document details how I setup LE on my server. Firstly, install the client as described on and make sure you can execute it. I put it in /root/letsencrypt.

As it is not possible to change the ports used for the standalone authenticator and I already have a nginx running on port 80/443, I opted to use the webroot method for each of my domains (note that LE does not issue wildcard certificates by design, so you probably want to get a cert for and


For this, I placed config files into etc/letsencrypt/configs, named after <domain>.conf. The files are simple:

mbajur / .md
Created Apr 29, 2016
How to create small, unique tokens in Ruby
View .md

How to create small, unique tokens in Ruby

That is is basically a "fork" of blog article i'm constantly returning to. It seems that the blog is down:

My choice: Dave Bass’s rand().to_s() trick

Dave Bass proposed this which I picked up for my implementation (here for an 8-chars token):

View gist:d65c92445f48603424e7

(important) Setup ubuntu to use aufs driver for drone

sudo apt-get install linux-image-extra-$(uname -r)
sudo reboot

Install docker

curl -s | sudo sh


mbajur /
Created Jun 27, 2014
Add git branch name to terminal prompt (mac)

Open up your bash profile file with

vim ~/.bash_profile

and at the end of that file, add:

# Git branch in prompt.
parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
You can’t perform that action at this time.