Skip to content

Instantly share code, notes, and snippets.

View ludmanp's full-sized avatar

Mark Leidman ludmanp

View GitHub Profile
@ludmanp
ludmanp / Update remote repo
Created November 24, 2024 10:15 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@ludmanp
ludmanp / VerifyAwsV4Signature.php
Last active May 3, 2024 11:40
AWS V4 Signature verification
<?php
namespace App\Services;
use GuzzleHttp\Psr7\Query;
use GuzzleHttp\Psr7\Utils;
use Illuminate\Http\Request;
use Psr\Http\Message\RequestInterface;
class VerifyAwsV4Signature
@ludmanp
ludmanp / binder.php
Created March 13, 2019 16:10 — forked from arodbits/binder.php
Combine binding values into a raw SQL query in Laravel. Debugging in Laravel.
<?php
//example:
$query = Foo::where('id', '=', 1)->where('name', '=', 'bar');
//would produce the following raw query:
//select * from foo where id = ? and name = ?;
dd(vsprintf(str_replace('?', '%s', $query->toSql()), collect($query->getBindings())->map(function($binding){
return is_numeric($binding) ? $binding : "'{$binding}'";