Skip to content

Instantly share code, notes, and snippets.

View zzzarius's full-sized avatar
👋

Darius Zivertas zzzarius

👋
View GitHub Profile
[...Array(100).keys()]
// Output: [0, 1, 2, 3, ..., 98, 99]
@zzzarius
zzzarius / get-schema.sh
Last active September 25, 2024 10:39
Get graphql schema from Contentful
npm install -g graphqurl
gq https://graphql.contentful.com/content/v1/spaces/<space_id>/environments/<environment_name> -H 'Authorization: Bearer <CONTENTFUL_ACCESS_TOKEN>' --introspect > schema.graphql
@zzzarius
zzzarius / iterpolation.js
Created December 4, 2024 20:51
Interpolate string template js
const interpolate = function(template, params) {
const names = Object.keys(params);
const vals = Object.values(params);
return new Function(...names, `return \`${template}\`;`)(...vals);
}