Skip to content

Instantly share code, notes, and snippets.

View mugli's full-sized avatar
🤷

Mehdi Hasan Khan mugli

🤷
View GitHub Profile

Import a MySQL Table or Database to a BigQuery Schema.

Usage:

~/bin/mysql_table_to_big_query.sh bucket_name schema_name table_name

~/bin/mysql_schema_to_big_query.sh bucket_name \[schema_name\].
@mugli
mugli / anmeldung-termin-notifier.sh
Last active February 8, 2023 19:55
Little bash script to repeatedly check if any appointment slot is available for Anmeldung (apartment registration) in Berlin
#!/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 / 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:

@mugli
mugli / concurrency-patterns.md
Last active September 6, 2022 05:03
go concurrency patterns collection

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 / 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 / go-mod-tools.md
Last active May 22, 2021 07:46
Tools/docs related to Go modules
@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

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
// ==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==