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
| import { createClient } from "@sanity/client"; | |
| const client = createClient({ | |
| projectId: "bcvqsdfp", | |
| dataset: "production", | |
| apiVersion: "2023-01-01", | |
| useCdn: true, | |
| }); | |
| export const fetchEvents = async () => { |
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
| var data = { | |
| "title": "flare", | |
| "children": [ | |
| { | |
| "title": "analytics", | |
| "children": [ | |
| { | |
| "title": "cluster", | |
| "children": [ | |
| { "title": "AgglomerativeCluster", "value": 3938 }, |
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
| import React, { Fragment } from "react" | |
| import { View } from "./" | |
| const Stack = ({ children, gap = 2, ...rest }) => { | |
| const Wrapper = Object.keys(rest).length > 0 ? View : Fragment | |
| const childrenWithProps = React.Children.map(children, (child, index) => { | |
| if (!child) return null | |
| if (index === 0 || index === children.length - 1) { | |
| return child | |
| } |
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
| It's annoying to see the build folder being removed while a new build is being created. Error 500 for as long as the build takes... | |
| Instead of 'build', the 'live' folder is being served to the client. | |
| When the build has succeeded, the 'live' folder is being renamed to 'backup', and the 'build' is being renamed to 'live' to take its place. On rollback, the 'backup' will be put back into place. | |
| "removeBackup": "! test -d backup || rm -r ./backup", | |
| "removeRevoked": "! test -d revoked || rm -r ./revoked", | |
| "renameLiveToBackup": "! test -d live || mv ./live ./backup", | |
| "renameLiveToRevoked": "! test -d live || mv ./live ./revoked", | |
| "renameBackupToLive": "! test -d backup || mv ./backup ./live", |
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
| "data": { | |
| "id": 8271, | |
| "name": "The Wall", | |
| "slug": "the-wall", | |
| "customer": { | |
| "id": 7643, | |
| "name": "BNP Nogwat" | |
| }, | |
| "products": [ | |
| { |
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
| // Like this: | |
| const Item = ({value}) => <li>{value}</li>; | |
| const Iteration = ({data}) => ( | |
| <ul> | |
| {data.map((value, index) => <Item key={index} value={value}/>)} | |
| </ul> | |
| ); |
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
| // swap children on hover | |
| /* | |
| <Hover> | |
| <span>this</span> | |
| <span>that</span> | |
| </Hover> | |
| */ | |
| import React, { Component } from 'react'; | |
| export default class Hover extends Component { | |
| constructor () { |
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
| // http://dmfrancisco.github.io/react-icons/ | |
| // http://www.rudinswagerman.nl/ | |
| /* | |
| <Icon size="2rem" icon="my-icon" /> | |
| */ | |
| import React from 'react'; | |
| const renderGraphic = icon => { |
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
| Add to app .plst | |
| <key>NSAppTransportSecurity</key> | |
| <dict> | |
| <key>NSAllowsArbitraryLoads</key> | |
| <true/> | |
| </dict> | |
| var getJSON = function(url) { | |
| return new Promise(function(resolve, reject) { |