Skip to content

Instantly share code, notes, and snippets.

View SekibOmazic's full-sized avatar

Sekib Omazic SekibOmazic

View GitHub Profile
@SekibOmazic
SekibOmazic / branching-strategy.md
Last active May 15, 2023 14:38
branching-strategy

Example Git Branching Diagram

  1. Create a new diagram with diagrams.net (formerly draw.io)
  2. Go to File > Open From > URL
  3. For branching strategy 1 insert this url (it points to the xml file below): https://gist.githubusercontent.com/SekibOmazic/4eda7773193091ad859ed3cf7ba48c06/raw/52e2cb7d85986a4a73518293ab28814ee31e73bb/strategy1.xml
  4. For branching strategy 2 insert this url: https://gist.githubusercontent.com/SekibOmazic/4eda7773193091ad859ed3cf7ba48c06/raw/9ff26daf950f34c9b8bcea9f4d172e1ad2b93e40/strategy2.xml

Difference between strategies

Example Git Branching Diagram

  1. Create a new diagram with diagrams.net (formerly draw.io)
  2. Go to File > Open From > URL
  3. Insert this url (it points to the xml data below): https://gist.githubusercontent.com/SekibOmazic/4badc0ca7789bdb90f06bce9965420ad/raw/d2310bc2454d83147b97900d9649e6f397ef2f25/template.xml

@SekibOmazic
SekibOmazic / docker-volumes.md
Created March 20, 2023 15:14 — forked from onlyphantom/docker-volumes.md
Demystifying Docker Volumes for Mac and PC Users

Demystifying Docker Volumes for Mac and PC Users

  1. Docker runs on a Linux kernel

Docker can be confusing to PC and Windows users because many tutorials on that topic assume you're using a Linux machine.

As a Linux user, you learn that Volumes are stored in a part of the host filesystem managed by Docker, and that is /var/lib/docker/volumes. When you're running Docker on a Windows or Mac OS machine, you will read the same documentation and instructions but feel frustrated as that path don't exist on your system. This simple note is my answer to that.

When you use Docker on a Windows PC, you're typically doing one of these two things:

  • Run Linux containers in a full Linux VM (what Docker typically does today)
@SekibOmazic
SekibOmazic / Zero_knowledge_db.md
Created September 29, 2019 09:17 — forked from thiloplanz/Zero_knowledge_db.md
Zero-knowledge databases

Zero knowledge databases

The idea

The idea is to provide a database as a service to end users in such a way that no one except the user herself can access the data, not even the hosting provider or the database administrator.

Advantages

  • A privacy- and/or security-conscious user will have more trust in such a setup.
  • The service provider cannot be coerced to release the data they were trusted with, and he cannot be held responsible for the content he is storing.
@SekibOmazic
SekibOmazic / fetch_with_status.re
Last active April 1, 2018 10:34
fetch with status
module Http = {
type error =
| Timeout
| NetworkError
| BadStatus(int, string);
let getJSON = (url: string) =>
Js.Promise.(
Fetch.fetch(url)
|> then_(value => {
Js.log(value);
@SekibOmazic
SekibOmazic / who_is_my_mummy.sh
Created March 12, 2018 12:20 — forked from joechrysler/who_is_my_mummy.sh
Find the nearest parent branch of the current git branch
#!/usr/bin/env zsh
git show-branch -a \
| grep '\*' \
| grep -v `git rev-parse --abbrev-ref HEAD` \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//'
# How it works:
@SekibOmazic
SekibOmazic / reason-remote-data.re
Created October 21, 2017 16:26 — forked from busypeoples/reason-remote-data.re
ReasonML port remote-data
/*
remote-data ported to ReasonML
See also https://github.com/krisajenkins/remotedata
Tools for fetching data from remote sources (incl. HTTP).
*/
type remoteData 'e 'a
= NotAsked
| Loading
@SekibOmazic
SekibOmazic / README.md
Created October 21, 2017 16:25 — forked from busypeoples/README.md
Making Impossible States Impossible in ReasonML

Making Impossible States Impossible in ReasonML

Introduction

If you have already seen Richard Feldman's talk entitled "Making Impossible States Impossible" or have read "Designing with types: Making illegal states unrepresentable" then you can skip the explanations and just head straight to the Reason examples.

This post is intended to display how to model your Reason Application to prevent creating impossible states. The benefits of being able to design a feature in this way include avoiding having to deal with complex test scenarios regarding defined business rules and a clear documentation of what is possible just by looking at the type definition. Long story short, let's see how this all works by implementing an example.

Requirements

@SekibOmazic
SekibOmazic / UIPattern.re
Created October 21, 2017 15:34 — forked from busypeoples/UIPattern.re
Slaying a UI Anti Pattern in ReasonML
/*
Slaying a UI Anti Pattern in ReasonML
Based on Kris Jenkins original writing.
http://blog.jenkster.com/2016/06/how-elm-slays-a-ui-antipattern.html
*/
type remoteData 'e 'a =
| NotAsked
| Loading
| Failure 'e
| Success 'a;
@SekibOmazic
SekibOmazic / opam-editors.txt
Created October 7, 2017 12:59
opam config for VIM and Emacs
Quick setup for VIM
-------------------
Append this to your .vimrc to add merlin to vim's runtime-path:
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
execute "set rtp+=" . g:opamshare . "/merlin/vim"
Also run the following line in vim to index the documentation:
:execute "helptags " . g:opamshare . "/merlin/vim/doc"
Quick setup for EMACS