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 $ from 'jquery'; | |
const Colors = { | |
element: $('.background-color'), | |
steps: [ | |
'rgb(238, 212, 177)', | |
'rgb(255, 255, 255)', | |
'rgb(245, 202, 229)', |
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
<?php | |
function responsiveImage($image, $classNames = [], $sizes = '100vw', $upscale = false) { | |
$widths = [2800, 1400, 1000, 600, 400, 100]; | |
$imageWidth = $image->width(); | |
$defaultClass = 'srcset-image'; | |
if (gettype($classNames) === 'string') $classNames = explode(' ', $classNames); | |
array_push($classNames, $defaultClass); | |
$classString = join($classNames, ' '); |
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
<?php | |
// site/plugins/page-methods.php | |
/* | |
* getAllImageURLs | |
* | |
* Returns an array of image objects for each image in the page | |
* (See the buildImage function at the bottom of this gist) |
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
// @flow | |
import React from 'react' | |
import axios from 'axios' | |
import R from 'ramda' | |
import Login from './Login' | |
/** | |
* LoginController | |
*/ |
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
/** | |
* Dependencies | |
*/ | |
const express = require('express') | |
const Multer = require('multer') | |
const Busboy = require('busboy') | |
const os = require('os') | |
const fs = require('fs') | |
const path = require('path') |
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 postmark = require('postmark') | |
const config = require('../config') | |
const client = new postmark.Client(config.postmark.key) | |
const sendEmail = async ({ From = config.fromEmail, To, Subject, HTMLBody, TextBody, ...opts }) => { | |
await client.sendEmail({ | |
From, | |
To, | |
Subject, |
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 db from '../../database' | |
import type { PaginationArgs, PageType } from './types' | |
// Sample Usage: | |
// const tenJapaneseUsers = await getUsers({ first: 10, filter: [{ key: 'locale', value: 'jp' }]) | |
const getUsers = async ({ first = 50, filter, after = 0 }: PaginationArgs): Promise<PageType | null | Error> => { | |
const filterQuery = filter | |
? filter.reduce((acc, { key, operator }) => `${acc}FILTER u.${key} ${operator || '=='} @${key}`, '') |
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
// @flow | |
import React from 'react' | |
import type { Node } from 'react' | |
import { ApolloProvider } from 'react-apollo' | |
import { ApolloLink } from 'apollo-link' | |
import { ApolloClient } from 'apollo-client' | |
import { onError } from 'apollo-link-error' | |
import { InMemoryCache } from 'apollo-cache-inmemory' | |
import { createUploadLink } from 'apollo-upload-client' |
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
Welcome* | |
selectedTeacherFlow -> TeacherFlow | |
selectedStudentFlow -> StudentFlow | |
StudentFlow | |
back -> Welcome | |
SelectClassroom | |
selectedClassroom -> SelectStudent | |
SelectStudent | |
selectedStudent -> UserLogin | |
TeacherFlow |
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
StudentLogin* | |
clickedTeacherLogin -> TeacherLogin | |
back -> StudentLogin | |
SelectClassroom | |
selectedClassroom -> SelectStudent | |
SelectStudent | |
selectedStudent -> UserLogin | |
TeacherLogin | |
clickedStudentLogin -> StudentLogin | |
EnterTeacherEmail |
OlderNewer