Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Mehdi Hasan Khan mugli

💭
I may be slow to respond.
View GitHub Profile
View notify-on-termin.js
// ==UserScript==
// @name Termin Notifier
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://service.berlin.de/terminvereinbarung/*
// @icon https://www.google.com/s2/favicons?domain=berlin.de
// @grant none
// ==/UserScript==
@mugli
mugli / json_read.go
Created Feb 20, 2021 — forked from sugab/json_read.go
Read JSON File form a filePath. American movies dataset can be found here: https://raw.githubusercontent.com/prust/wikipedia-movie-data/master/movies.json. 200,000+ Jeopardy question dataset can be found here: https://www.reddit.com/r/datasets/comments/1uyd0t/200000_jeopardy_questions_in_a_json_file/.
View json_read.go
package main
import (
"encoding/json"
"io/ioutil"
)
func readJSON(fileName string, filter func(map[string]interface{}) bool) []map[string]interface{} {
datas := []map[string]interface{}{}
@mugli
mugli / concurrency-patterns.md
Last active Feb 16, 2021
go concurrency patterns collection
View concurrency-patterns.md
@mugli
mugli / gist:9ff786fb83f76151be90b7a45b1f49d5
Created Aug 11, 2020 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos
View gist:9ff786fb83f76151be90b7a45b1f49d5

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
@mugli
mugli / django-shell-notebook-setup.md
Created Jun 19, 2020 — forked from madyasiwi/django-shell-notebook-setup.md
Guide to setup Django-shell Jupyter notebook running in Docker container
View django-shell-notebook-setup.md

Setting Up Django-Shell Jupyter Notebook in Docker Container

This guide assumes that your django application already running in the container.

1. Install required python packages

You will have to make sure that django-extensions and jupyter packages are installed in the container's python virtual environment.

If you need to shell into the container as root user to do this, you can do so from the host PC:

@mugli
mugli / anmeldung-termin-notifier.sh
Last active Oct 20, 2020
Little bash script to repeatedly check if any appointment slot is available for Anmeldung (apartment registration) in Berlin
View anmeldung-termin-notifier.sh
#!/bin/bash
# Check if xidell is present (required for extracting from webpage using xpath)
if ! command -v xidel &> /dev/null
then
printf "\n\nCould not find xidel \n\n"
echo "You can install it with (on a mac):"
echo "brew install xidel"
exit
fi
@mugli
mugli / postgres-cheatsheet.md
Created Apr 7, 2020 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

PSQL

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)
View Twitter mute words.md

Visit https://twitter.com/settings/muted_keywords Open your browser's dev tools (note: this does work in Chrome) Paste the following code in:

const delayMs = 500; // change this if you feel like its running too fast

const keywords = `ActivityTweet
@mugli
mugli / mac-apps.md
Created Jan 16, 2020 — forked from erikreagan/mac-apps.md
Mac developer must-haves
View mac-apps.md

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@mugli
mugli / introrx.md
Created Nov 10, 2019 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md