Skip to content

Instantly share code, notes, and snippets.

💭
❤️✖️🤖

Janez Troha dz0ny

💭
❤️✖️🤖
Block or report user

Report or block dz0ny

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
View graphql-posts-pag.php
<?php
add_action('graphql_register_types', 'PostsWithPaginationConnection', 99);
function PostsWithPaginationConnection()
{
$connection_args = array_merge(['offset' => [
'type' => 'Int',
'description' => __('Offset for current results', 'wp-graphql'),
]], \WPGraphQL\Connection\PostObjects::get_connection_args());
$config = [
'fromType' => 'RootQuery',
View class-text-domain-cache.php
<?php
/*
Plugin Name: WooCart Machine Objects Cache
Description: Cache for localization files.
Version: 1.5.0
*/
class TexDomainCache
{
View gist:1ce91bb9d604fe45cba82ca2d58692ae
[input_source]
library=builtin
label=source
purpose=capture
disable=(not (equal? dsp_name "extmic_eq"))
output_0={in_src:0}
output_1={in_src:1}
[input_sink]
library=builtin
View gist:7551f92ba8be5c47fde62183b647017a
var_export(timezone_identifiers_list());
array (
0 => 'Africa/Abidjan',
1 => 'Africa/Accra',
2 => 'Africa/Addis_Ababa',
3 => 'Africa/Algiers',
4 => 'Africa/Asmara',
5 => 'Africa/Bamako',
6 => 'Africa/Bangui',
7 => 'Africa/Banjul',
@dz0ny
dz0ny / readme.md
Last active May 28, 2018
VPN ClusterRole
View readme.md

kubectl create serviceaccount manager@vpnui

@dz0ny
dz0ny / buildHAProxy.sh
Last active Oct 25, 2019 — forked from codingtony/buildHAProxy.sh
Recipe to build HAProxy 1.8 using LibreSSL. Builds an almost static binary. See https://github.com/codingtony/docker-build-haproxy for how to use with a Docker Image
View buildHAProxy.sh
#!/bin/bash -e
DIR=$PWD/work
mkdir -p ${DIR}
rm -f ${DIR}/*.tar.gz
LIBRESSL=libressl-2.4.5
HAPROXY=haproxy-1.8.4
PCRE=pcre-8.39
View gist:22db8e4d7bee5d2450b8dd45b8075fae
dev="vpn-swan"
gw=$(ip a show $dev| grep "inet\b" | awk '{print $2}' | cut -d/ -f1)
ip rule del from 10.10.10.0/24
ip rule add from 10.10.10.0/24 priority 10 table 100
ip route add 10.10.10.0/24 dev $dev table 100
ip route add default via $gw dev $dev table 100
ip route flush cache
iptables -I FORWARD -o $dev -j ACCEPT
iptables -t nat -I POSTROUTING -o $dev -j MASQUERADE
@dz0ny
dz0ny / wp-mem-usage.php
Created Sep 27, 2017 — forked from BigWhale/wp-mem-usage.php
WordPress theme memory usage
View wp-mem-usage.php
add_action( 'shutdown', 'do_shutdown', 999);
function do_shutdown() {
$f = fopen('/tmp/memory_usage.txt', 'a+');
$usage = memory_get_peak_usage( true );
fwrite( $f, $usage / 1024 / 1024 . " MB\n" );
fclose( $f );
}
View ble.java
package com.gopro.wsdk.domain.camera.network.a;
import java.util.UUID;
/* compiled from: BleConstants */
public class h {
static final int[] a = new int[]{754, 1793};
static final byte[] b = new byte[0];
/* compiled from: BleConstants */
View dz0ny.pub
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQENBFix3f8BCADmUtVVZYebmLv3Dva1u0iJOkLrnJBtSFIqWG5ohN5Tps8+8ghu
3NLfDzT0d+MOsqLhWy2kfGP0sTZnboodxFrH6gTP9XVk3tDR364aIzBfrwppZ26N
5h09QjYr8MnPD6WVBmhInolNY2M4WiWL7jXhGB63o9ocQWKSt1XYrgp717syh4sn
pFrWw6KLZZXRlIuy21jFHPykz5xtO9IVRcN3EgMZwRxfocXFG13B6kAoxy1zOk+D
Nci7kpfS0tmFLgatYtJXB0CvjgJyCI/r2twiLj9dMj6+BJeqyT3kvyJGEiJOFyRA
XO31bgWrYPtvI+RuJUTbiWH3m9OoXPiUHRGdABEBAAG0HUphbmV6IFRyb2hhIDxk
ejBueUB1YnVudHUuc2k+iQE3BBMBCAAhBQJYsd3/AhsDBQsJCAcCBhUICQoLAgQW
AgMBAh4BAheAAAoJEL0gikYgWTfyq+MH/iItNQHT2HQiBb+ao2tf//5+H0pnkSUs
You can’t perform that action at this time.