Skip to content

Instantly share code, notes, and snippets.

View yuchenQ's full-sized avatar

Yuchen Qiao yuchenQ

View GitHub Profile
@yuchenQ
yuchenQ / data.js
Last active May 17, 2021 00:34
PFA criteria 2
const largerThan = [5000]; // >= 5000 ? > 5000 ?
const smallerThan1 = [1, 5000] // <= 5000 ?
const smallerThan2 = [0, 4999] // < 5000 ?
const equal = [1, 1];
const ptrData = [
{
id: 'frostie-brizzie',
@yuchenQ
yuchenQ / data.js
Last active May 17, 2021 01:28
PFA criteria 1
const largerThan = [5000]; // >= 5000 ? > 5000 ?
const smallerThan1 = [1, 5000] // <= 5000 ?
const smallerThan2 = [0, 4999] // < 5000 ?
const equal = [1, 1];
// 3 X 3 OR 4 X 4 OR 5 X 5
const pouch = {
id: 'pouch-ptr-id',
@yuchenQ
yuchenQ / initWorker
Created April 28, 2021 05:29
initWorker
const initWorker = (workerFn) => {
const iife = `(${workerFn.toString()})()`;
const blob = new Blob([iife], { type: 'text/javascript' });
const fileURL = URL.createObjectURL(blob);
const worker = new Worker(fileURL);
worker.cleanup = () => {
URL.revokeObjectURL(fileURL);
// GET /reviews/mine
{
"reviews": [
{
"id": 3749,
"artistAccountId": 12,
"artistFederatedId": "mock:tman",
"createdAt": "2020-08-14T01:38:31Z"
}
]
query {
assignedReviews: assignedReviews
}
type assignedReviews {
reviews: [review]
}
type review {
id: ID!
# BEFORE: defining schema type based on what we get from API
# when we call "GET" content API:
type content {
workId: String! # must have a string
artistId: String!
tags: [String!]! # Array<String>
sourceImages: [sourceImage!]!
}
# when we call "GET" recommandedContent API:
@yuchenQ
yuchenQ / cloudSettings
Created August 27, 2018 07:29
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-08-27T07:29:46.409Z","extensionVersion":"v3.1.0"}
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->