Skip to content

Instantly share code, notes, and snippets.

Say hi!

Michał Michalczuk michalczukm

Block or report user

Report or block michalczukm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
michalczukm / .gitignore
Created Dec 7, 2018
.NET Core apps minimal .gitignore (including publication settings)
View .gitignore
# User-specific files
# Build results
michalczukm / value-types.ts
Last active Aug 9, 2018
Example of using values as types - with type assertion
View value-types.ts
const Foo = {
aFoo: 'SomeAfoo' as 'SomeAfoo',
bFoo: 'SomeBfoo' as 'SomeBfoo',
cFoo: 'SomeCfoo' as 'SomeCfoo',
type FooValueTypes = (typeof Foo)[keyof typeof Foo];
function doStuff(value: FooValueTypes) {

How to add an image to a gist

  1. Create or find a gist that you own.
  2. Clone your gist (replace <hash> with your gist's hash):
    # with ssh
    git clone<hash>.git mygist
    # with https
    git clone<hash>.git mygist
michalczukm / extensions.json
Last active Jul 9, 2018
VS Code recommended workspace extensions for any Angular project (and not only :) )
View extensions.json
// See to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
michalczukm /
Last active Mar 12, 2019
Visual Studio Extensions list and short script to build installable list
# ======= Generate extensions list by:
#code --list-extensions | while read line; do
# echo code --install-extension $line
# ======== My current extensions list
code --install-extension
code --install-extension EditorConfig.EditorConfig
code --install-extension PeterJausovec.vscode-docker
michalczukm /
Created Jan 22, 2018
Clone index to another (reindex) in Elastic Search (ELS)
curl -X POST http://localhost:9200/_reindex?pretty=true -d '{
"source": {
"index": "dev_1"
"dest": {
"index": "dev_2"
michalczukm /
Created Jan 22, 2018
Get Elastic Search (ELS) data via cURL, to file
curl -X GET http://localhost:9200/dev-1/categorysearchproductmodel/_search?pretty=true -d '{
"sort" : [
{ "_uid" : {"order" : "asc"}}
"query": {
"match_all": {}
}' > els-now.json
michalczukm /
Created Nov 25, 2017 — forked from spalladino/
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
michalczukm / docker-compose.yaml
Created Nov 23, 2017
elasticsearch + kibana docker-compose
View docker-compose.yaml
version: "2.2"
container_name: elasticsearch
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
michalczukm / azure-function-get-ip.js
Created Nov 13, 2017
Azure function - ask for my current IP
View azure-function-get-ip.js
const https = require('https');
module.exports = function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
https.get('', res => {
let body = '';
res.on('data', data => {
body += data;
You can’t perform that action at this time.