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 name = document.querySelector('.name'); | |
const email = document.querySelector('.email'); | |
const firstpassword = document.querySelector('.password1'); | |
const secondpassword = document.querySelector('.password2'); | |
const textName = document.querySelector('.nameText'); | |
const textEmail = document.querySelector('.emailText'); | |
const textPassword = document.querySelector('.passwordText'); | |
const textPassword2 = document.querySelector('.passwordText2'); | |
const button = document.querySelector('button'); | |
const popup = document.querySelector('.popup'); |
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 name = document.querySelector('.name'); | |
const email = document.querySelector('.email'); | |
const error = document.querySelector('.error'); | |
const firstpassword = document.querySelector('.password1'); | |
const secondpassword = document.querySelector('.password2'); | |
const textName = document.querySelector('.nameText'); | |
const textEmail = document.querySelector('.emailText'); | |
const textPassword = document.querySelector('.passwordText'); | |
const button = document.querySelector('button'); |
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
// Ideally you would import the Jump library explicitly, but don't sweat it. ;) | |
const jump = Jump; | |
// ⬇ Moved this up here as there is no reason for the variable to be set to undefined first. | |
const imageArray = [ | |
{ | |
image: 'img/mattias@400px.png', | |
description: | |
'Hemsida för content marketing specialisten och tidigare SVT-sportjournalist Mattias Brännholm. Wordpress.', | |
}, | |
{ |
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 sets up a very lightweight App State based on React Context API | |
* with a familiar reducer / actions / dispatcher syntax, and also exposes | |
* this to Redux Devtools which is good and not bad. | |
* More info here: https://medium.com/simply/state-management-with-react-hooks-and-context-api-at-10-lines-of-code-baf6be8302c | |
* ...and here: https://github.com/troch/reinspect | |
*/ | |
import React, { createContext, useContext } from 'react'; | |
import { useReducer } from 'reinspect'; | |
import PropTypes from 'prop-types'; |
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
/** | |
* Cloud function triggered by changes in dataset which will generate metadata for art asset. | |
*/ | |
const Promise = require('es6-promise').Promise; | |
const sanityClient = require('@sanity/client'); | |
/** Setup */ | |
const client = token => sanityClient({ | |
projectId: '<projectId>', |
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 function getBaseType(input) { | |
return ({}).toString.call(input).match(/\s([a-zA-Z]+)/)[1]; | |
} | |
export function getType(input, restricted = false) { | |
let output = getBaseType(input); | |
if (restricted) return output; | |
if (output.toLowerCase() === 'object') output = input.type ? input.type.name : input.constructor.name; | |
return output; | |
} |
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 function isDateInRange(checkPointIn, startPointIn, endPointIn) { | |
if ([checkPointIn, startPointIn, endPointIn].some((point) => point === undefined)) { | |
console.warn('Function expects three parameters; checkPoint: Date, startPoint: Date, endPoint: Date'); | |
return; | |
} | |
const checkPoint = new Date(checkPointIn).getTime(); | |
const startPoint = new Date(startPointIn).getTime(); | |
const endPoint = new Date(endPointIn).getTime(); | |
return checkPoint > startPoint && checkPoint < endPoint; |
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 function getShape(object, depth = 1) { | |
const tab = ' '; | |
const prefix = tab; | |
let output = '{\n'; | |
Object.keys(object).forEach((key) => { | |
const type = typeof (object[key]); | |
let desc = ''; | |
if (type === 'function') { | |
desc = 'func'; |
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
package com.ctrloptcmd.string { | |
/** | |
* Copyright 2009 Martin Jacobsen. | |
* | |
* @langversion ActionScript 3.0 | |
* @playerversion Flash 10.0 | |
* | |
* @author Martin Jacobsen | |
* @since 2009-02-02 |
NewerOlder