This post has been moved to my blog, under Color Management in three.js.
This file contains 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
/* | |
Allows you to hijack the new Customer Accounts login flow and redirect to a custom page after login. | |
10SQ - 2024 | |
10sq.dev | |
*/ | |
const SHOP_ID = "<YOUR-SHOP-ID>"; | |
const CLIENT_ID = "<YOUR-CLIENT-ID>"; // Install https://apps.shopify.com/headless |
This file contains 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
{% comment %} | |
UPDATE: Now you can use this theme to more easily manage your redirects: | |
https://github.com/benjaminsehl/shopify-headless-theme | |
{% endcomment %} | |
{% assign new_website = 'https://headless-website.com/' %} | |
<!doctype html> | |
<html> |
youtube-dl is an opensource command line tool to download video or audio from online video streaming services.
Videos downloaded in mkv
or webm
extensions can be played by VLC Media player in all major devices and operating systems including iPhone, Android devices.
Tool website: https://youtube-dl.org/
This gist shows the example commands to use the tool and doesn't support or encourage piracy or violation of copyrights of the online streaming service or the author of the content
This file contains 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
// https://discourse.threejs.org/t/functions-to-calculate-the-visible-width-height-at-a-given-z-depth-from-a-perspective-camera/269 | |
function visibleHeightAtDepth(depth, camera) { | |
// compensate for cameras not positioned at z=0 | |
const cameraOffset = camera.position.z; | |
if ( depth < cameraOffset ) depth -= cameraOffset; | |
else depth += cameraOffset; | |
// vertical fov in radians | |
const vFOV = camera.fov * Math.PI / 180; | |
// Math.abs to ensure the result is always positive |
This file contains 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
vec3 hueShift( vec3 color, float hueAdjust ){ | |
const vec3 kRGBToYPrime = vec3 (0.299, 0.587, 0.114); | |
const vec3 kRGBToI = vec3 (0.596, -0.275, -0.321); | |
const vec3 kRGBToQ = vec3 (0.212, -0.523, 0.311); | |
const vec3 kYIQToR = vec3 (1.0, 0.956, 0.621); | |
const vec3 kYIQToG = vec3 (1.0, -0.272, -0.647); | |
const vec3 kYIQToB = vec3 (1.0, -1.107, 1.704); |
This file contains 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
:root { | |
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53); | |
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19); | |
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22); | |
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06); | |
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035); | |
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335); | |
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94); | |
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1); | |
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1); |
This file contains 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
const cloneGltf = (gltf) => { | |
const clone = { | |
animations: gltf.animations, | |
scene: gltf.scene.clone(true) | |
}; | |
const skinnedMeshes = {}; | |
gltf.scene.traverse(node => { | |
if (node.isSkinnedMesh) { |
This file contains 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
import React from 'react'; | |
import Route from 'react-router-dom/Route'; | |
import Link from 'react-router-dom/Link'; | |
import Switch from 'react-router-dom/Switch'; | |
const App = ({ routes, initialData }) => { | |
return routes | |
? <div> | |
<Switch> | |
{routes.map((route, index) => { |
NewerOlder