Skip to content

Instantly share code, notes, and snippets.

@sicet7
sicet7 / jwk_with_phpseclib_test.php
Last active September 6, 2023 16:29
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": [
{
@ciases
ciases / git-zip-changed-files.md
Last active March 23, 2024 16:37
Git: zip changed files + diff

GIT: zip changed files + diff

Create zip archive with changed files

git archive -o update.zip HEAD $(git diff --name-only <starting SHA> HEAD)

or

import (
log "github.com/sirupsen/logrus"
"github.com/jinzhu/gorm"
)
type GormLogger struct {}
func (*GormLogger) Print(v ...interface{}) {
if v[0] == "sql" {
log.WithFields(log.Fields{"module": "gorm", "type": "sql"}).Print(v[3])
@PurpleBooth
PurpleBooth / README-Template.md
Last active September 27, 2024 19:56
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites