Skip to content

Instantly share code, notes, and snippets.


Michal Landsman landsman

Block or report user

Report or block landsman

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
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;
landsman / fix_airbank_ib.js
Created Feb 4, 2019
Dear Airbank, this is tutorial how to fix your Internet Banking. Leave me there email where can I send invoice. Thanks.
View fix_airbank_ib.js
let popHandler = () => {
document.getElementById("id22a").click(); // click on your stupid fake go back button
window.addEventListener('popstate', popHandler, {once: true})
landsman /
Last active Feb 25, 2019
Pass variables for each docker-compose file - two environments
echo "Starting fresh containers for DEVELOPMENT"
docker/ dev.env
docker-compose -f docker/dev/docker-compose.yml up --build --remove-orphans
landsman /
Created Jan 2, 2019 — forked from DemkaAge/
ResourceBundle UTF-8 Control class
import java.util.Locale;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
landsman / .htaccess
Created Dec 9, 2018
webp pres htacesss - drupal coloseum
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
# Check if browser support WebP images
RewriteCond %{HTTP_ACCEPT} image/webp
# Check if WebP replacement image exists
RewriteCond %{DOCUMENT_ROOT}/$1.$2.webp -f
# Serve WebP image instead
RewriteRule (.+)\.(jpe?g|png)$ $1.$2.webp [T=image/webp,E=accept:1]
<IfModule mod_headers.c>
#!/bin/bash -e
if [ $# -ne 2 ]; then
echo "Usage: $0 <instance-id> <volume-size-gb> [PARITION_NAME=/dev/xvda2]"
exit 2
sudo apt-get install jq -y
You can’t perform that action at this time.