Skip to content

Instantly share code, notes, and snippets.

Jonny Barnes jonnybarnes

Block or report user

Report or block jonnybarnes

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 gist:cab298061f58c4734fd4cd75f7cc97f1
BEGIN MESSAGE.
RaYyxqqFhOmFksm Up5kwFwLqC06oSW biD2UdkzdCtkU1Q TYmT2GFuxD6gucN
rbEPSlJZBokNyGA vd3S07jFTTKTCKq 6Xr2MZHgg6vmr8L WgOCVQgEeG2cp9E
DXaBZbVS2PxNyLe 8mAaFeimxu8R1I3 L7ybwzCY79ePatc yWp97QXS5BtkELl
YYvoPdk3R8w1PHJ apBItQo423EKB4u j2sDh0aLMzWSiL.
END MESSAGE.
@jonnybarnes
jonnybarnes / unbound.conf
Created Dec 29, 2019
My unbound configuration, use securedns.eu with dnssec validation
View unbound.conf
server:
verbosity: 1
port: 53
username: "jonny"
tls-cert-bundle: "/usr/local/etc/openssl@1.1/cert.pem"
auto-trust-anchor-file: "/usr/local/etc/unbound/root.key"
aggressive-nsec: yes
hide-identity: yes
hide-version: yes
prefetch: yes
@jonnybarnes
jonnybarnes / conflict.php
Created Aug 6, 2019
Used in my PHP Traits post for BuildEmpire
View conflict.php
<?php
trait One
{
public function hello()
{
echo 'Hello One' . PHP_EOL;
}
public function bye()
@jonnybarnes
jonnybarnes / class.php
Created Aug 6, 2019
Used in my PHP Traits post for BuildEmpire
View class.php
<?php
namespace Foo;
class MyClass
{
use Bar;
}
@jonnybarnes
jonnybarnes / trait.php
Created Aug 6, 2019
Used in my PHP Traits post for BuildEmpire
View trait.php
<?php
namespace Foo;
trait Bar
{
public function baz(string $value): string
{
// modify $value in some way
return mb_strtoupper($value)
View standard-heredoc.php
<?php
$variable = <<<TOKEN
Some text
TOKEN;
View jsonexception.php
<?php
try {
json_decode('{invalid{json', false, 512, JSON_THROW_ON_ERROR);
} catch (\JSONException $exception) {
MyLogger::error($exception->getMessage());
}
View 73-heredoc.php
<?php
class Foo
{
public static function bar(bool $input)
{
if ($input === true) {
$variable = <<<TOKEN
Hello
World!
View 72-heredoc.php
<?php
class Foo
{
public static function bar(bool $input)
{
if ($input === true) {
$variable = <<<TOKEN
Hello
World!
@jonnybarnes
jonnybarnes / 72-heredoc.php
Last active Sep 11, 2018
Embeds for my PHP 7.3 BuildEmpire blog post
View 72-heredoc.php
<?php
// some class
// some method
// an if statement
$variable = <<<TOKEN
Hello
World!
TOKEN;
You can’t perform that action at this time.