Skip to content

Instantly share code, notes, and snippets.

View kaznovac's full-sized avatar
🕷️
digital insecticide service

Marko Kaznovac kaznovac

🕷️
digital insecticide service
View GitHub Profile
<?php
declare(strict_types=1);
use PHPUnit\Framework\Constraint\Callback;
use PHPUnit\Framework\Constraint\Constraint;
use function array_column;
use function count;
@kaznovac
kaznovac / doctrine.php
Created December 2, 2022 09:10
Symfony Doctrine Bundle PHP configuration
<?php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use Symfony\Config\DoctrineConfig;
use Symfony\Config\FrameworkConfig;
return static function (DoctrineConfig $doctrine, ContainerConfigurator $container, FrameworkConfig $framework): void {
$dbal = $doctrine->dbal();
$dbal->defaultConnection('default');
@kaznovac
kaznovac / jwt-apn-2.sh
Last active July 28, 2022 20:58
apple push notification jwt token signing from terminal
#!/usr/bin/env bash
# https://developer.apple.com/documentation/usernotifications/sending_push_notifications_using_command-line_tools#3694579
TEAM_ID=Team ID
TOKEN_KEY_FILE_NAME=path to the private key file
AUTH_KEY_ID=your key identifier
TOPIC=App ID
DEVICE_TOKEN=device token for your app
APNS_HOST_NAME=api.sandbox.push.apple.com
@kaznovac
kaznovac / traefik_portainer.md
Created January 24, 2022 10:25 — forked from ruanbekker/traefik_portainer.md
Traefik with SSL + Portainer on Docker Swarm Repro

Traefik and Portainer on Docker Swarm with Letsencrypt

Reproducing a Traefik with SSL and Portainer setup on a 2 Node Docker Swarm

Install Docker:

Install Docker on both nodes with a Bootstrap Script:

$ curl https://gitlab.com/rbekker87/scripts/raw/master/setup-docker-ubuntu.sh | bash
@kaznovac
kaznovac / ext-xdebug.ini
Created June 27, 2020 16:30
php xdebug 2.x configuration
[xdebug]
zend_extension="xdebug.so"
xdebug.coverage_enable=1
xdebug.default_enable=1
xdebug.extended_info=1
xdebug.file_link_format="phpstorm://open?file=%f&line=%l"
xdebug.max_nesting_level=256
xdebug.scream=0
#!/bin/bash
daemonize () { "$@"& pid="$!"; trap "kill -INT $pid" INT TERM; while kill -0 $pid > /dev/null 2>&1; do wait $pid; ec="$?"; done; exit $ec;};
@kaznovac
kaznovac / bash-zsh-statup-scripts.md
Created January 21, 2019 21:35
order of bash/zsh startup scripts execution

bash

For Bash, startup scripts work as follows. Read down the appropriate column. Executes A, then B, then C, etc. The B1, B2, B3 means it executes only the first of those files found.

Interactive login Interactive non-login Script
@kaznovac
kaznovac / keybase.md
Created September 12, 2018 16:07
keybase

Keybase proof

I hereby claim:

  • I am kaznovac on github.
  • I am kaznovac (https://keybase.io/kaznovac) on keybase.
  • I have a public key whose fingerprint is E4A4 06EB 5AD8 3750 736C AB31 D8F7 58BA 8C2E 9090

To claim this, I am signing this object:

@kaznovac
kaznovac / locationd-edit.sh
Created September 7, 2018 14:53
edit mac os location database (to remove uninstalled apps)
/usr/libexec/PlistBuddy /var/db/locationd/clients.plist
killall -HUP locationd
#!/bin/bash
XDEBUG_CONFIG="idekey=xdebug" php -dxdebug.remote_host=`echo $SSH_CLIENT | cut -d "=" -f 2 | awk '{print $1}'` "$@"