Skip to content

Instantly share code, notes, and snippets.

Avatar
👀

Hans Pagel hanspagel

👀
View GitHub Profile
@hanspagel
hanspagel / CustomTable.js
Last active Feb 1, 2022
Update the Table `width` when the `colwidth` of a TableCell is updated
View CustomTable.js
const CustomTable = Table.extend({
// Add a `width` attribute
addAttributes() {
return {
...this.parent?.(),
width: {
default: null,
},
}
},
View CustomMarkdown.php
<?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 Apr 3, 2021
hocuspocus tsconfig.json
View tsconfig.json
{
"compilerOptions": {
"target": "es2019",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"esModuleInterop": true,
View gist:7e81b5f31cf8ce036b249cc41e89f741
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',
View Superscript.js
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 Jan 27, 2020
Generate Open Graph Images for Blog Posts
View OpenGraphImageController.php
<?php
namespace App\Http\Controllers;
use GDText\Box;
use GDText\Color;
use App\Models\Post;
use Illuminate\Support\Facades\Cache;
class OpenGraphImageController extends Controller
View css
.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;
}
View Docker alpine php 7.1-fpm with geoip
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 Aug 23, 2018
Laravel Nova Migration with Postgres Uuid Support
View 2018_01_01_000000_create_action_events_table.php
<?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
{
View .zshrc
# jump to web projects
alias web='cd ~/Documents/Websites'
# repeat last command with sudo
alias lol='sudo "$BASH" -c "$(history -p !!)"'
# alias for docker-compose
alias dcp='docker-compose'
# run artisan in docker