Skip to content

Instantly share code, notes, and snippets.

View royteusink's full-sized avatar

Roy Teusink royteusink

View GitHub Profile
@jordienr
jordienr / tailwind.config.ts
Created July 15, 2023 09:10
Tailwind SVG Grid Background
// Remember to install mini-svg-data-uri
// Follow me on twitter for memes @jordienr
import { type Config } from "tailwindcss";
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
const svgToDataUri = require("mini-svg-data-uri");
export default {
@phanan
phanan / MyList.vue
Last active February 2, 2023 17:10
Virtual scroller with Vue Composition API
<template>
<VirtualScroller v-slot="{ item }" :item-height="35" :items="myMassiveArray">
<div :item="item" :key="item.id">{{ item.details.i.guess? }}</div>
</VirtualScroller>
</template>
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@lukaskleinschmidt
lukaskleinschmidt / HandleInertiaRequests.php
Last active November 24, 2024 08:22
inertia-laravel multiple root views
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Inertia\Middleware;
class HandleInertiaRequests extends Middleware
{
@vivgui
vivgui / bigger-tailwindcss-spacing-scale.js
Last active August 28, 2023 21:55
Here's a bigger spacing scale for TailwindCSS.
spacing: {
"13": '3.25rem',
"15": '3.75rem',
"17": '4.25rem',
"18": '4.5rem',
"19": '4.75rem',
"76": "19rem",
"84": "21rem",
"88": "22rem",
"92": "23rem",
@royteusink
royteusink / vue-sanctum.md
Last active December 31, 2020 13:21
vue cli + laravel sanctum

CORS issues with local development setup Laravel Sanctum with Vue3 cli

app.yourdomain.test

vue app created with vue cli.

axios.create({
  baseURL: process.env.VUE_APP_API_URL,
  withCredentials: true
@vicgonvt
vicgonvt / deployment_guide.md
Last active October 22, 2024 21:47
Deployment Guide for Ubuntu Server from Scratch with Laravel
@Ron-e
Ron-e / bash.txt
Created September 2, 2018 10:09
remove services before installing Sentora
yum remove -y httpd httpd-devel php php-devel php-gd php-mbstring php-intl php-mysql php-xml php-xmlrpc php-mcrypt php-imap php-pear php-mysql php-cli php-common php5-dev myself mysql dovecot-mysql MariaDB MariaDB-common MariaDB-compat MariaDB-server phpMyAdmin postfix dovecot dovecot-mysql dovecot-pigeonhole sendmail ProFTPd proftpd proftpd-mysql vsftpd named bind bind-utils bind-libs bind9 pdns pdns-backend-mysql pdns-server pdns-server-backend-mysql webalizer crontabs
yum clean all
yum install -y curl
@blackcater
blackcater / diagrams.md
Created July 6, 2018 16:45
Markdown Diagrams

Diagrams

Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams. You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.

Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.

Flow Charts

This feature is powered by flowchart.js.

@ryanhamley
ryanhamley / use-svg-as-icon-image-mapboxgl.js
Last active October 25, 2024 12:42
This gist shows how to use an <svg> element as an icon-image for a Mapbox GL symbol layer
// How to add an SVG as a symbol layer's icon image: https://github.com/mapbox/mapbox-gl-js/issues/5529#issuecomment-340011876
// Also see here: https://stackoverflow.com/a/11765731/2748013 (we need the data url stuff for the image src)
// NOTE: Importing SVGs requires an inline module loader such as https://github.com/webpack-contrib/svg-inline-loader
import template from './templates/marker.svg';
const width = 20;
const height = 40;
const img = new Image(width, height);
// map is your Mapbox GL map object