Skip to content

Instantly share code, notes, and snippets.


Michal Landsman landsman

View GitHub Profile
landsman /
Created Aug 13, 2021
test script to send next.js assets to google storage
export ASSETS_FOLDER="../.next/static"
export GCP_BUCKET=""
export VERSION="test-gzip-3"
TIME_START=$(date +%s)
gsutil -m -q \
cp -r -z "js,css,html,json" \
landsman / myFAQ.js
Last active Apr 23, 2021
draft how to handle faq data for multiple countries on company site
View myFAQ.js
// this is my wanna be database
// a) I can turn off/on every faq item for each individual country
// b) all locales are by default handled via lingui, and there are no duplicates
// c) it can be easily refactored to API response in future :)
export const faqItems = [
id: 'whenMoney',
landsman / .bash_aliases
Created Apr 18, 2021
compress file with progress bar
View .bash_aliases
function compress () {
if [ -z "$1" ]; then
# display usage if no parameters given
echo "Usage: compress <path/folder-or-file> <new-file.tar.gz>"
return 1
tar cf - $1 -P | pv -s $(du -sb $1 | awk '{print $1}') | gzip > $2
landsman / domains.txt
Last active Oct 25, 2020
email domains fixer
View domains.txt
# gmail typos,,,,,
landsman / .bash_aliases
Last active Jul 20, 2020
golden cage for user
View .bash_aliases
# system
alias apt='echo "apt"'
alias sudo='echo "sudo"'
alias apt-get='echo "apt-get"'
alias uname='echo "uname"'
alias service='echo "service"'
alias du='echo "du"'
alias df='echo "df"'
alias btrfs='echo "btrfs"'
alias shred='echo "shred"'
landsman / gist:e229888c7cb8a400851976dd59f029ca
Created Jan 19, 2020
drupal 8 deployment backup - 2y ago
View gist:e229888c7cb8a400851976dd59f029ca
# Deployment
*Build action* process:
# copy database parameters
cp "$DPSETTINGSPATH" docroot/sites/default/settings.production.php
# fix chmods
chmod 644 docroot/sites/default/settings.production.php
landsman /
Last active Sep 2, 2019
AWS: Install docker and docker-compose on Amazon Linux 2
#!/usr/bin/env bash
sudo amazon-linux-extras install docker -y
sudo systemctl enable docker
sudo systemctl start docker
sudo service docker start
DOCKER_COMPOSE_VERSION=$(curl -s | sed -n 's/.*tag_name":\s"\(.*\)".*/\1/p' | head -1)
sudo curl -L$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
landsman /
Created Jun 5, 2019
virtualbox mojave setup
readonly VM_RES="1366x768"
readonly NAME="Hackintosh"
VBoxManage modifyvm "$NAME" --usbxhci on --firmware efi --chipset ich9 --mouse usbtablet --keyboard usb
VBoxManage setextradata "$NAME" "CustomVideoMode1" "${VM_RES}x32"
VBoxManage setextradata "$NAME" VBoxInternal2/EfiGraphicsResolution "$VM_RES"
VBoxManage modifyvm "$NAME" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
landsman /
Last active Mar 26, 2019
dump whatever object type you want to console output, inspired by
package helper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public final class DevTools
public static String dump(Object stuff) throws JsonProcessingException {
return null;
View RouterFactory.php
namespace App;
use Nette;
use Nette\Application\Routers\RouteList;
use Nette\Application\Routers\Route;
use Kdyby\Doctrine\EntityManager;
use App\Model\CatalogModel;
use App\Model\PageModel;