Skip to content

Instantly share code, notes, and snippets.

View mugli's full-sized avatar
🤷

Mehdi Hasan Khan mugli

🤷
View GitHub Profile
@mugli
mugli / README.md
Created November 11, 2022 22:12 — forked from ascendbruce/README.md
Use macOS-style shortcuts in Windows

Use macOS-style shortcuts in Windows / keyboard mappings using a Mac keyboard on Windows

Make Windows PC's shortcut act like macOS (Mac OS X) (using AutoHotkey (ahk) script)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

How does it work

Here's some examples of how this script work:

Go Learning Resources

1) For someone who is just beginning or have relatively short time:

2) When someone who knows some Go already:

@mugli
mugli / go-mod-tools.md
Last active May 22, 2021 07:46
Tools/docs related to Go modules
@mugli
mugli / data-race.go
Created May 20, 2021 08:07
Concurrency in Go
/*
A data race happens when processes have to access the same variable concur
rently i.e. one process reads from a memory location while another simultaneously
writes to the exact same memory location.
*/
func main() {
number := 0;
go func(){
@mugli
mugli / avoid-deadlock-with-select.go
Created May 18, 2021 14:25
Concurrency - "Learning Go" book
func main() {
ch1 := make(chan int)
ch2 := make(chan int)
go func() {
v := 1
ch1 <- v
v2 := <-ch2
fmt.Println(v, v2)
}()
v := 2
// ==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 February 20, 2021 17:06 — 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/.
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 September 6, 2022 05:03
go concurrency patterns collection
@mugli
mugli / gist:9ff786fb83f76151be90b7a45b1f49d5
Created August 11, 2020 11:57 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos

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 June 19, 2020 13:49 — forked from madyasiwi/django-shell-notebook-setup.md
Guide to setup Django-shell Jupyter notebook running in Docker container

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: