I hereby claim:
- I am rohjay on github.
- I am rohjay (https://keybase.io/rohjay) on keybase.
- I have a public key ASBJpJtc5SN3cMx5WuTvZ6AHD1SY3yr0hUGd-fqX0EMg2go
To claim this, I am signing this object:
| <?php | |
| class Hasheesh | |
| { | |
| public static $algo = False; | |
| public static function init() | |
| { | |
| $algos = array(); | |
| foreach ( hash_algos() as $algo ) { |
| <?php | |
| // I find myself grouping a lot of data... heres a quick helper function to do just that =] | |
| function grouper($data, $key_to_group_by, $key_to_group_unfound='unfound', $unset_key_from_data=false) { | |
| $grouped_results = array(); | |
| foreach ( $data as $k => $value ) { | |
| $value_key = isset($value[$key_to_group_by]) ? $value[$key_to_group_by] : $key_to_group_unfound; | |
| if ( !isset($grouped_results[$value_key]) ) { | |
| $grouped_results[$value_key] = array(); |
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| function var_dump_to_error_log($data) { | |
| ob_start(); | |
| var_dump($data); | |
| $error_log_this = ob_get_contents(); | |
| ob_end_clean(); | |
| error_log($error_log_this); | |
| } |
Update: please note that I have since switched to using a set of bash scripts instead of poluting the Git repository with git svn.
Author: Kaspars Dambis
kaspars.net / @konstruktors
| <?php | |
| /** | |
| This is a simple class to help you render values into templates, rather than echoing large strings of html/whatever. | |
| Usage: | |
| // Set the base directory of all of your template files and instantiate the Templater | |
| $base_dir = __DIR__ . '/templates'; | |
| $templater = new Templater($base_dir); |
| # PS1 stuff... | |
| reset=$(tput -Txterm sgr0) | |
| color=$(tput -Txterm setaf 3) | |
| altcolor=$(tput -Txterm setaf 2) | |
| export PS1="\[$color\]\u\[$reset\]@\[$altcolor\]\h\[$reset\]::\w>" | |
| ## Quick nav | |
| alias ..="cd ../" | |
| alias ~="cd ~" |
| <?php | |
| // I PHP-ified Ben's work from here: https://github.com/ben-yocum/gestalt-pattern-matcher (thanks for sharing Ben!) | |
| // made a few modifications and added comments to better understand how this works. Enjoy =] | |
| function compare_strings(string $input1, string $input2, bool $case_insensitive = true): float { | |
| if ( $input1 == '' || $input2 == '' ) { | |
| return 0.0; | |
| } | |
| // Case insensitive is the preferred, but you do you |
| <?php | |
| /* | |
| Plugin Name: Hostile XMLRPC Responder | |
| Plugin URI: https://kneejerk.dev | |
| Description: A MUST use plugin designed to respond to XMLRPC requests with a little hostility =] | |
| Version: 2.8.1 | |
| Author: Ryan "Rohjay" Oeltjenbruns | |
| Author URI: https://rohjay.one | |
| Requires at least: 6.0 | |
| Requires PHP: 8.0 |