Skip to content

Instantly share code, notes, and snippets.

@hayden-t
hayden-t / github_webhook_filter.php
Last active August 24, 2023 10:51
GitHub Webhook Discord filter by branch for PHP
<?php
//filter githubs webhooks by using this conditional relay script
//used for discord, but also usable for other needs.
//set the webhook url in github to the public url to this php file
$headers = getallheaders();
//file_put_contents('/home/user/public_html/webhook_data.txt', json_ensode($headers) );//debug
$rawPostBody = file_get_contents('php://input');
@hayden-t
hayden-t / OAuthClient.php
Created February 8, 2019 07:41 — forked from hubgit/OAuthClient.php
PHP OAuth 1.0 client using cURL
<?php
class OAuthClient {
/** @var OAuth */
public $oauth;
/** @var cURL */
public $curl;
function __construct(array $config) {
@hayden-t
hayden-t / test.php
Last active January 28, 2019 04:54
php debug backtrace
<?php
foreach(debug_backtrace() as $i){
echo $i['file'].' '.$i['line'].' ' .$i['function'].'<br/>';
}