Skip to content

Instantly share code, notes, and snippets.

@mwleinad
mwleinad / LICENSE.txt
Last active March 27, 2020 15:46 — forked from LeverOne/LICENSE.txt
generate random v4 UUIDs (107 bytes)
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
@mwleinad
mwleinad / RemoveLastCommitGit
Created March 20, 2020 17:13
Remove last commit from git
$ git commit -m "Something terribly misguided" # (1)
$ git reset HEAD~ # (2)
<< edit files as necessary >> # (3)
$ git add ... # (4)
$ git commit -c ORIG_HEAD
@mwleinad
mwleinad / LastExecutedQuery.php
Created March 13, 2020 15:34
Log last executed query in laravel
<?php
\DB::connection()->enableQueryLog();
//Eloquent or db query.
$query = \DB::getQueryLog();
$lastQuery = end($query);
\Log::info($lastQuery);
@mwleinad
mwleinad / CaptionAmazonService.php
Created September 6, 2019 15:22
For those that are looking for a way to create an srt or vtt file from Amazon Transcribe Service
<?php
//Not everything will work out of the box for you, as this is just for our application.
//Framework Laravel
namespace Modules\Caption\Services;
//https://github.com/captioning/captioning
use Captioning\Format\WebvttFile;
use ilos\Models\Caption\CaptionRequest;
use Exception;
@mwleinad
mwleinad / gist:a47f9d469383d46c91fe22e7351f3845
Created July 18, 2018 14:54
Salesloft Payload decryption in PHP
<?php
namespace Modules\Integrations\Salesloft\Services;
use Jose\Component\Core\AlgorithmManager;
use Jose\Component\Encryption\Algorithm\KeyEncryption\A256GCMKW;
use Jose\Component\Encryption\Algorithm\ContentEncryption\A256GCM;
use Jose\Component\Encryption\Compression\CompressionMethodManager;
use Jose\Component\Encryption\Compression\Deflate;
use Jose\Component\Encryption\JWEDecrypter;
@mwleinad
mwleinad / lti.jsp
Last active April 12, 2018 14:55
Embed LTI and Oauth signature on jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="blackboard.platform.session.*,
java.util.*,
java.net.*,
blackboard.data.user.*,
blackboard.persist.*,
blackboard.data.course.*,
blackboard.persist.course.*,
javax.crypto.spec.SecretKeySpec,