Skip to content

Instantly share code, notes, and snippets.

View Potherca's full-sized avatar
🤔
I wonder what this button does…

Ben Peachey Potherca

🤔
I wonder what this button does…
View GitHub Profile
@Potherca
Potherca / git-bisect-phpunit.sh
Created May 27, 2012 12:32 — forked from havvg/git-bisect-phpunit.sh
git bisect phpunit wrapper
#!/bin/bash
phpunit
EXIT_CODE="$?"
if [ $EXIT_CODE -eq "255" ]; then
# Wrapping the error code to 1, so bisect marks this build as "bad" and continues.
exit 1
fi
@Potherca
Potherca / gist:9041249
Last active August 29, 2015 13:56 — forked from weotch/gist:1959748
Running PHP scripts from CLI on Heroku
# Add this config
$ heroku config:add LD_LIBRARY_PATH=/app/php/ext:/app/apache/lib
# Login to Heroku CLI
$ heroku run bash
# The second argument here is the path to your script
~ $ ~/php/bin/php -f ~/www/index.php
@Potherca
Potherca / blocksite-allow-with-password-enhancement.js
Created August 27, 2017 13:57
Changes the functionality of the "Enter password to allow" screen of the "BlockSite" Chrome extension to permanently allow a domain.
/* Add dependencies needed to call `addPageToStorage` */
$('head').append('<script src="chrome-extension://eiimnmioipafcokbfikbljfdeojpcgbh/options.js"></script>');
$('body').append('<span id="login_label" style="display:none;"></span>');
trackButton = function(){};
init = function(){};
/* Define our custom event handler */
function handleLoginEvent(event) {
if(event.keyCode === undefined || event.keyCode === 13){
@Potherca
Potherca / Basic Nextcloud server on Ubuntu.md
Last active September 30, 2022 08:11 — forked from michielbdejong/Basic Nextcloud server on Ubuntu
Steps to setting up a Nextcloud server from scratch using an Ubuntu-based VPS
@Potherca
Potherca / jwk_with_phpseclib_test.php
Created July 17, 2023 10:28 — forked from sicet7/jwk_with_phpseclib_test.php
Use JWK from JSON with the lcobucci/jwt library through phpseclib. Credit to @whatTool for helping with the implementation
<?php
//REQUIREMENTS!
//"phpseclib/phpseclib": "^3.0"
//"lcobucci/jwt": "^5.0"
require_once __DIR__ . '/vendor/autoload.php';
$json = '{
"keys": [
{