Skip to content

Instantly share code, notes, and snippets.

View ismailbenhallam's full-sized avatar
🏠
Working from home

Ismaïl BENHALLAM ismailbenhallam

🏠
Working from home
View GitHub Profile
package coroutines
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import java.net.URI
import java.net.http.HttpClient
import java.net.http.HttpRequest
git config --global alias.ignore \
'!gi() {
curl -sL “https://www.toptal.com/developers/gitignore/api/$@” >> .gitignore
echo "Updated .gitignore file for $@"
}; gi'
@ismailbenhallam
ismailbenhallam / Makefile help
Last active February 18, 2023 21:42
A function that prints the Makefile help, if a Makefile exists..
makehelp() {
if [ -f Makefile ]; then
awk -F "#" \
'BEGIN {print "Available commands:"} \
/^[[:alnum:]_-]+:.*$/ && !/^default/ && !/^#/ \
{ for (i = 1; i <= NF; i++) gsub(/^[[:space:]]+|[[:space:]]+$/, "", $i); \
$1 = sprintf("%-20s", $1); \
if (length($2) == 0) $2 = "\033[33mNo description\033[30m"; \
else $2 = "\033[37m" $2 "\033[30m";
print "\033[32m" $1 "\t\t\t" $2}' Makefile
@ismailbenhallam
ismailbenhallam / index.ts.hbs
Last active December 11, 2021 23:05
Plop config for React app
export { default } from "./{{pascalCase name}}";
const capitalize = (string) => {
return string ? string[0].toUpperCase() + string.substring(1) : "";
};