Skip to content

Instantly share code, notes, and snippets.

Avatar

Maciej Łebkowski mlebkowski

View GitHub Profile
View cleanup-docker.sh
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(
View update-heroku-db
#!/bin/bash
set -euo pipefail
parse_dsn() {
declare dsn=$1 part=$2
php -r 'echo parse_url($_SERVER["argv"][1], constant("PHP_URL_" . strtoupper($_SERVER["argv"][2])));' -- "$dsn" $part
}
@mlebkowski
mlebkowski / Makefile
Last active Feb 6, 2020
Polish IT Conferences
View Makefile
EXECUTABLES = php aws curl awk
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),,$(error "No $(exec) in PATH")))
all: vendor app.php
php app.php > conferences.ical
aws s3 cp --acl public-read --content-type "text/calendar" conferences.ical s3://polish-it-conferences/conferences.ical --profile polish-it-conferences
vendor: composer composer.json composer.lock
./composer install
View docker-compose.yml
version: "3"
services:
www:
build: .docker/php
command: gulp browser-sync --proxy http://backend
working_dir: /app
ports:
- 3000:3000
View Rumble Stats.md

50001

1 DireTide 2 First Floor 3 Kill All Humans! 4 GUARDIAN ANGELS 5 The Lost Cartel 6 Acts of Vengeance 7 Black Lotus 8 Best Of The Best Of The Best

View cartoon-diff.sh
#!/bin/bash
SOURCE=${SOURCE:-cartoon-dev}
TARGET=${TARGET:-cb-live}
FILES=(cards.xml cards_finalform.xml cards_mythic.xml levels.xml combos.xml missions.xml)
ENDPOINT="http://%s.synapse-games.com/assets/%s"
get_diff() {
declare file=$1
View export.sh
#!/bin/bash
export_diff() {
declare project=$1 period=$2 hash=$3
local person="$(git -C "$project" show --format="%an" -s "$hash")"
local target="output/$period/$person/${project#projects/}/$hash.html"
mkdir -p "$(dirname "$target")"
View WatchAdsChore.php
<?php
namespace Nassau\CartoonBattle\Services\Farming\Chores;
use Nassau\CartoonBattle\Entity\Game\Farming\UserFarming;
use Nassau\CartoonBattle\Services\Farming\FarmingChore;
use Nassau\CartoonBattle\Services\Game\Game;
class WatchAdsChore implements FarmingChore
{
View swole-club.txt
Training times and costs:
Level 1
30 minutes
Gun Show:100
Gems:27
Level 2
1 hour
Gun Show:250
View AclModeratorsUpdater.php
<?php
class AclModeratorsUpdater
{
/**
* @var MutableAclProviderInterface
*/
private $provider;
public function __construct(MutableAclProviderInterface $provider)
You can’t perform that action at this time.