Skip to content

Instantly share code, notes, and snippets.

View jonnybarnes's full-sized avatar
:octocat:

Jonny Barnes jonnybarnes

:octocat:
View GitHub Profile
BEGIN MESSAGE.
RaYyxqqFhOmFksm Up5kwFwLqC06oSW biD2UdkzdCtkU1Q TYmT2GFuxD6gucN
rbEPSlJZBokNyGA vd3S07jFTTKTCKq 6Xr2MZHgg6vmr8L WgOCVQgEeG2cp9E
DXaBZbVS2PxNyLe 8mAaFeimxu8R1I3 L7ybwzCY79ePatc yWp97QXS5BtkELl
YYvoPdk3R8w1PHJ apBItQo423EKB4u j2sDh0aLMzWSiL.
END MESSAGE.
@jonnybarnes
jonnybarnes / unbound.conf
Created December 29, 2019 20:09
My unbound configuration, use securedns.eu with dnssec validation
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 August 6, 2019 14:19
Used in my PHP Traits post for BuildEmpire
<?php
trait One
{
public function hello()
{
echo 'Hello One' . PHP_EOL;
}
public function bye()
@jonnybarnes
jonnybarnes / class.php
Created August 6, 2019 14:16
Used in my PHP Traits post for BuildEmpire
<?php
namespace Foo;
class MyClass
{
use Bar;
}
@jonnybarnes
jonnybarnes / trait.php
Created August 6, 2019 14:14
Used in my PHP Traits post for BuildEmpire
<?php
namespace Foo;
trait Bar
{
public function baz(string $value): string
{
// modify $value in some way
return mb_strtoupper($value)
<?php
$variable = <<<TOKEN
Some text
TOKEN;
<?php
try {
json_decode('{invalid{json', false, 512, JSON_THROW_ON_ERROR);
} catch (\JSONException $exception) {
MyLogger::error($exception->getMessage());
}
<?php
class Foo
{
public static function bar(bool $input)
{
if ($input === true) {
$variable = <<<TOKEN
Hello
World!
<?php
class Foo
{
public static function bar(bool $input)
{
if ($input === true) {
$variable = <<<TOKEN
Hello
World!
@jonnybarnes
jonnybarnes / 72-heredoc.php
Last active September 11, 2018 20:01
Embeds for my PHP 7.3 BuildEmpire blog post
<?php
// some class
// some method
// an if statement
$variable = <<<TOKEN
Hello
World!
TOKEN;