Skip to content

Instantly share code, notes, and snippets.

View landsman's full-sized avatar

Michal Landsman landsman

View GitHub Profile
@pento
pento / php-block.js
Last active March 20, 2025 14:59
Converting a shortcode to a block: this method is fast to do, but a mediocre UX. You should only use this as a stopgap until you can implement a full block UI.
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
/*
* Here's where we register the block in JavaScript.
@rozenmd
rozenmd / macOS-setup.sh
Last active August 1, 2023 22:40
Set up a macOS device for development in one script.
#!/bin/bash
# Brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
####################################
# Brew apps
####################################
brew install cask
@pantsel
pantsel / docker-compose.yml
Last active October 2, 2025 02:21
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
@dluc
dluc / IgnoreTrailingSlashesRequestHandler.java
Created July 10, 2018 01:47
Play Framework 2.6 Request Handler to ignore trailing slash
import com.google.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import play.api.mvc.Handler;
import play.api.mvc.Handler$;
import play.api.mvc.RequestHeader;
import play.core.j.JavaHandler;
import play.core.j.JavaHandlerComponents;
import play.http.HandlerForRequest;
import play.http.HttpRequestHandler;
import play.libs.streams.Accumulator;
@dg
dg / composing.presenters.php
Created May 31, 2018 14:00
Composing presenters without inheritance
<?php
// composing presenters without inheritance
// (requires nette/application 2.4.11)
trait RequireLoggedUser
{
public function injectRequireLoggedUser()
{
@sairamkrish
sairamkrish / Dockerfile
Last active August 13, 2024 00:24
Dockerfile for gradle, spring boot application using multi-stage feature
FROM openjdk:8 AS TEMP_BUILD_IMAGE
ENV APP_HOME=/usr/app/
WORKDIR $APP_HOME
COPY build.gradle settings.gradle gradlew $APP_HOME
COPY gradle $APP_HOME/gradle
RUN ./gradlew build || return 0
COPY . .
RUN ./gradlew build
FROM openjdk:8
@chewbh
chewbh / README.md
Last active July 30, 2018 14:49
Ubuntu Desktop Setup

Software Engineer Ubuntu based Lappy Setup

Software Installation List

  • nvm and node.js
  • java 8/9
  • sublime text 3
  • google chrome
  • visual studio code
@vojtasvoboda
vojtasvoboda / .gitlab-ci.yml
Last active December 5, 2020 16:29
GitLab CI FTP deploy with mwienk/docker-lftp docker image
stages:
- test
- deploy
cache:
paths:
- vendor
# test job
test:
@idoshamun
idoshamun / Dockerfile
Created November 3, 2017 07:39
Dockerizing Scala Application
FROM openjdk:8-jre-alpine
RUN mkdir -p /opt/app
WORKDIR /opt/app
COPY ./run_jar.sh ./app-assembly.jar ./
ENTRYPOINT ["./run_jar.sh"]
@jmolivas
jmolivas / ._README.md
Last active January 2, 2018 15:57
Basic docker configuration for drupal projects

Basic docker configuration for drupal projects

Extra steps

  1. If not using DrupalConsole you will need to add the vlucas/phpdotenv dependency to load the .env file. You can do that using composer:
composer require vlucas/phpdotenv
  1. Add the TRAEFIK_HOST value to /etc/hosts