This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# I use this to setup my Laravel 10 (sail) docker container to setup PDO_Sqlsrv | |
# Let pecl auto-configure our php.ini | |
pear config-set php_ini /etc/php/8.1/cli/php.ini | |
# Setup PHP to be able to connect to SQLServer. | |
# From here: https://docs.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver16 | |
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | |
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console; | |
use Illuminate\Console\Scheduling\Schedule; | |
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | |
class Kernel extends ConsoleKernel | |
{ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://app.sunsama.com/*focus=true* | |
// @que | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\Support\Str; | |
use Illuminate\Support\Stringable; | |
/** | |
* Add isMatch() method to Str helper and Stringable objects. isMatch is the love hild |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* $browser->waitForAjax() macro for Laravel Dusk. See comment below for details. | |
**/ | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Laravel\Dusk\Browser; | |
class DuskServiceProvider extends ServiceProvider |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* An example of overriding the shouldRun method to add the default expectations to the Mock, | |
* instead of redefining it in all your tests. | |
* | |
* You can still call MakeEntryLine::shouldRun()->andReturn(...) | |
* to override the default expectations. | |
*/ | |
namespace App\Actions\Csv; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Transaction extends Model | |
{ | |
protected $primaryKey = 'TransactionID'; | |
/** | |
* Using Laravel to export data from a SQL Server Express 15.0 I ran into an issue when creating test models | |
* using my Eloquent Model Factory on some tables which did not have an Auto Incrementing primary | |
* key, and where the table was set to disallow inserting the Primary Key (IDENTITY_INSERT is set to OFF). | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The Simple Share Buttons uses wp_is_mobile() to decide how to render front end | |
* pages, which is incompatible with frontend caching. So filter the check | |
* to always return the "mobile version" (unless we are in the admin backend). | |
* | |
* Bbeware! It overrides _all_ frontend calls, not just SSBA ones). | |
* | |
* Save this as a mu-plugin ( wp-content/mu-plugins/disable-wp-is-mobile.php ) | |
* or paste it into your functions.php file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A little script to clear all your history at https://myactivity.google.com/myactivity | |
* | |
* Load Developer Console (usually F12), paste this into the Console and hit Enter (or Run). | |
* | |
* Doesn't use any cool magic, just simulates clicking on all the delete buttons. | |
**/ | |
var ClearGoogleMyAccount = | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is a bit of code to make it easier to turn forms into PHP Arrays | |
* for use in scrapers etc. | |
* It's designed to be run from the console, e.g in Firebug. Just copy | |
* everything from this file into the console and hit Go. It shouldn't | |
* take much to turn it into a browser extension by someone with the know how. | |
**/ | |
/** | |
* The arrays didn't seem to want to .concat, so I just call this |
NewerOlder