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
// @flow | |
import React from 'react'; | |
import { Textfit } from 'react-textfit'; | |
import _ from 'lodash'; | |
import { TweenMax, Back, Power4 } from 'gsap'; | |
import type { Song } from '../models'; | |
import styles from './SongList.css'; | |
export class PlayerSongList extends React.Component { |
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
export type WorkPlace = { | |
id:string | |
viewCount:number | |
participant:{ | |
male:number | |
female:number | |
ages:number[] | |
} | |
getAverageAges: ()=> number; |
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
// Batch image resizing with Node Imagemagick | |
// author: Rungsikorn Rungsikavanich | |
// contact: [email protected] | |
// Dependencies ( Need native imagemagick ) | |
// $ brew install imagemagick | |
// $ npm i imagemagick lodash | |
// example: `$ DIR=../static/images/stock/herbarium-original node ./lib/batch-resizer.js` | |
// result image will be locate in ./resize folder | |
const im = require('imagemagick'); |
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
new Resolver({ | |
resolve: async () => { | |
return new Promise((rs, rj) => { | |
Model.find({ _id }, function(err, result){ | |
rs(result); | |
}); | |
}) |
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
// args | |
// questionId, selectedChoiceId | |
const question = await Question.findById(id); | |
// search if questionId is exist | |
if(question.answers.filter( answer => answer.questionId === questionId ).length === 0){ | |
question.answers.push({ questionId, selectedChoiceId }); | |
} else { |
NewerOlder