This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is added to your `main.js` file, the one that imports and runs Async Alpine. Make sure that | |
* it runs before any `import()` functions by putting as high as possible. That may mean adding it to | |
* a static import if your other static imports dynamically import immediately. | |
*/ | |
__webpack_public_path__ = window.assetsPath; | |
/** | |
* If you want to automatically register all components within a certain directory as async, you can do | |
* that with `require.context()` and the fourth param as 'weak'. Add this to your main.js file and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// handlelize in liquid: https://github.com/Shopify/liquid/blob/63eb1aac69a31d97e343822b973b3a51941c8ac2/performance/shopify/shop_filter.rb#L100 | |
// how to handlelize in js: https://ricardometring.com/javascript-replace-special-characters | |
function handlelize (str) { | |
str = str.normalize('NFD').replace(/[\u0300-\u036f]/g, '') // Remove accents | |
.replace(/([^\w]+|\s+)/g, '-') // Replace space and other characters by hyphen | |
.replace(/\-\-+/g, '-') // Replaces multiple hyphens by one hyphen | |
.replace(/(^-+|-+$)/g, '') // Remove extra hyphens from beginning or end of the string | |
.toLowerCase(); // To lowercase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
from PIL import ImageTk,Image | |
import time | |
import os | |
targetImageWidth = 850 | |
targetImageHeight = 400 | |
inputImageWidth = 0 | |
inputImageHeight = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
attribute float direction; | |
attribute vec2 distances; | |
attribute float vertexThickness; | |
attribute vec3 nextPosition; | |
attribute vec3 previousPosition; | |
varying vec2 vUv; | |
const bool miter = false; | |
const float miterLimit = 8.0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// note : if you're on github gist and want to copy paste this code, you can click on the "Raw" button | |
// and then do Ctrl A, Ctrl C, Ctrl V | |
// (code below by Kurt Spencer, slightly modified code to run as Processing tab) | |
// maybe you should rather use this new (improved) version of the noise instead : https://github.com/KdotJPG/OpenSimplex2 | |
/* | |
* OpenSimplex Noise in Java. | |
* by Kurt Spencer | |
* | |
* v1.1 (October 5, 2014) |