Skip to content

Instantly share code, notes, and snippets.

Avatar

Arnold Daniels jasny

View GitHub Profile
@jasny
jasny / poc-standard.php
Created Jun 26, 2019
Proof of concept where `strict_types` affects `==` and `!=` operators
View poc-standard.php
<?php
var_dump("1" == 1);
var_dump("1" != 1);
@jasny
jasny / gen.php
Last active Jul 6, 2020
rfc:strict_operators - Generate every combination of operands and operators
View gen.php
<?php
$one = [
'arithmetic' => ['+$a', '-$a'],
'bitwise' => ['~$a'],
'incdec' => ['++$a', '--$a'],
'logical' => ['!$a'],
];
$two = [
@jasny
jasny / livecontract-yaml-to-json.php
Created Jun 13, 2019
Script to convert Live Contract scenario Yaml to JSON
View livecontract-yaml-to-json.php
<?php
$file = $argv[1];
$tagToStruct = function($value, $tag) {
$key = substr($tag, 1);
return ["<$key>" => $value];
};
$callbacks = [
@jasny
jasny / magic_8_ball.php
Last active May 27, 2019 — forked from happy-box/magic_8_ball.py
Simple magic 8-ball game written in PHP
View magic_8_ball.php
#!/usr/bin/env php
<?php
/**
* Magic 8 Ball IRC bot
* Created by Lance Brignoni
* Converted to PHP by Arnold Daniels
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
@jasny
jasny / sha256-hmac.md
Last active Oct 11, 2021
Hashing examples in different languages
View sha256-hmac.md

Example inputs:

Variable Value
key the shared secret key here
message the message to hash here

Reference outputs for example inputs above:

| Type | Hash |

@jasny
jasny / FooController.php
Last active Jul 11, 2018
Jasny Framework MVC
View FooController.php
<?php
class FooController extends Controller
{
/**
* @var FooGateway
*/
protected $foos;
/**
@jasny
jasny / gist:453fcd74045d74559f4c04ad1938c36f
Last active Sep 14, 2017
Rinkeby address - Main account
View gist:453fcd74045d74559f4c04ad1938c36f
0xfEBDC084cA75b7d053D22b93644d9D9A012f7859
@jasny
jasny / README.md
Last active Aug 14, 2018
New PHP library
View README.md

Jasny {{library}}

Build Status Scrutinizer Code Quality Code Coverage SensioLabsInsight BCH compliance Packagist Stable Version Packagist License

@jasny
jasny / phpbrew-php.sh
Created Apr 2, 2017
phpbrew-php automatically runs the correct PHP version for a project
View phpbrew-php.sh
#!/bin/bash
# phpbrew-php will determine the PHP version of the project from the NetBeans project or composer.json.
command_exists () {
type "$1" &> /dev/null ;
}
vergte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | tail -n1`" ]
@jasny
jasny / aws-setup.md
Created Nov 9, 2015
A simple guide on installing the AWS cli including how to obtain an access key
View aws-setup.md

AWS cli

Installation

To use the AWS and Elastic Beanstalk command line application, you need to install them using the Python package installer pip.

sudo pip install awscli awsebcli

Creating access keys