Skip to content

Instantly share code, notes, and snippets.

View hanspagel's full-sized avatar
👀

Hans Pagel hanspagel

👀
View GitHub Profile

Keybase proof

I hereby claim:

  • I am hanspagel on github.
  • I am hanspagel (https://keybase.io/hanspagel) on keybase.
  • I have a public key ASAfRC4yG0qyruU1xQRl5rg1OtzuSUIQLcge9EkFpVeX2go

To claim this, I am signing this object:

@hanspagel
hanspagel / CustomTable.js
Last active September 17, 2022 17:10
Update the Table `width` when the `colwidth` of a TableCell is updated
const CustomTable = Table.extend({
// Add a `width` attribute
addAttributes() {
return {
...this.parent?.(),
width: {
default: null,
},
}
},
<?php
namespace App\Drivers;
use SplFileInfo;
use FilesystemIterator;
use Orbit\Facades\Orbit;
use Illuminate\Support\Str;
use RecursiveIteratorIterator;
use RecursiveDirectoryIterator;
@hanspagel
hanspagel / tsconfig.json
Created April 3, 2021 11:50
hocuspocus tsconfig.json
{
"compilerOptions": {
"target": "es2019",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"esModuleInterop": true,
import { Extension } from '@tiptap/core'
import { Decoration, DecorationSet } from 'prosemirror-view'
import { Plugin } from 'prosemirror-state'
export default Extension.create({
name: 'placeholder',
defaultOptions: {
emptyEditorClass: 'is-editor-empty',
emptyNodeClass: 'is-empty',
import { Mark } from 'tiptap'
import { toggleMark } from 'tiptap-commands'
export default class Superscript extends Mark {
get name() {
return 'superscript'
}
get schema() {
@hanspagel
hanspagel / OpenGraphImageController.php
Last active January 27, 2020 07:17
Generate Open Graph Images for Blog Posts
<?php
namespace App\Http\Controllers;
use GDText\Box;
use GDText\Color;
use App\Models\Post;
use Illuminate\Support\Facades\Cache;
class OpenGraphImageController extends Controller
.artists-grid-wrapper > div:nth-child(1) {
-ms-grid-column: 6;
grid-column-start: 6;
-ms-grid-column-span: 5;
grid-column-end: 11;
-ms-grid-row: 1;
grid-row-start: 1;
ms-grid-row-span: 3;
grid-row-end: 4;
}
FROM php:7.1-fpm-alpine
RUN apk --no-cache add \
autoconf \
build-base \
geoip \
geoip-dev
RUN mkdir -p /usr/share/GeoIP && cd /usr/share/GeoIP/ && \
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz && \
@hanspagel
hanspagel / 2018_01_01_000000_create_action_events_table.php
Created August 23, 2018 11:26
Laravel Nova Migration with Postgres Uuid Support
<?php
// nova/database/migrations/2018_01_01_000000_create_action_events_table.php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateActionEventsTable extends Migration
{