This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
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, { useEffect } from 'react' | |
import gsap from 'gsap' | |
import { useFrame } from '@react-three/fiber' | |
// sync gsap raf to r3f raf | |
gsap.ticker.remove(gsap.updateRoot) | |
export const GsapTicker = () => { | |
const pg = React.useRef(0) | |
gsap.ticker.remove(gsap.updateRoot) |
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 { Model } from 'objection'; | |
export default class TaxRateModel extends Model { | |
countryCode!: string; | |
stripeId!: string; | |
static tableName = 'tax_rate'; | |
} |
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 S from '@sanity/desk-tool/structure-builder' | |
import eachDayOfInterval from 'date-fns/eachDayOfInterval' | |
import startOfYear from 'date-fns/startOfYear' | |
import startOfDay from 'date-fns/startOfDay' | |
import endOfDay from 'date-fns/endOfDay' | |
let now = new Date() | |
export default () => S.listItem() | |
.title('Entries by day this year') | |
.child( |
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
export default { | |
name: 'department', | |
type: 'document', | |
title: 'Department', | |
fields: [ | |
{ | |
name: 'title', | |
type: 'string', | |
title: 'Title', | |
}, |
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 sanityClient = require('@sanity/client'); | |
const crypto = require('crypto'); | |
const { | |
SANITY_API_TOKEN, | |
SANITY_PROJECT_ID, | |
SANITY_DATASET, | |
SHOPIFY_SECRET | |
} = process.env; |
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
/** | |
* This was a proof of concept for me to be able to | |
* retrieve an API key using a Netlify environment variable | |
* using this lambda function. I spent a lot of time looking | |
* for a complete example like this--without any luck. | |
* | |
* So, here's a step-by-step of what I did. | |
* | |
* 1) For this function to work, define the env variable in | |
* Netlify > Site > Build & Deploy > Environment > Edit Variables |
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://<example.com>/<namespace>/<project>/-/jobs/artifacts/<tag>/download?job=pages | |
# https://<example.com>/<namespace>/<project>/-/jobs/artifacts/<tag>/raw/<path_to_file>?job=pages | |
# Where: | |
# example.com - domain name your gitlab server | |
# namespace - your name user on the gitlab | |
# project - your project | |
# tag - ref of current job. | |
# If job run on only by tags, than ref will be named as tag name | |
# If job run on only master, than ref will be named as "master", i.e.: https://<example.com>/<namespace>/<project>/-/jobs/artifacts/master/download?job=pages | |
# path_to_file - path to file relative from root workspace folder |
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
// semantic-ui-form.js | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Form, Input } from 'semantic-ui-react'; | |
export default function semanticFormField ({ input, type, label, placeholder, meta: { touched, error, warning }, as: As = Input, ...props }) { | |
function handleChange (e, { value }) { | |
return input.onChange(value); | |
} |
Scroll effect / Image transition test for a project using PIXI for Webgl abstraction. Effect is made by drawing the image, scaling x, applying threshold and using that as a mask.
A Pen by Felix Nielsen on CodePen.
NewerOlder