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
const check = (suma, x, requireValues) => { | |
const deepCheck = y => { | |
return y | |
? Object.entries(y).reduce((sumb, z) => { | |
return check(sumb, z, requireValues); | |
}, {}) | |
: 'Required'; | |
}; | |
let 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="react-konva DEMO"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>react-konva DEMO</title> | |
<script type="text/javascript" src="https://cdn.rawgit.com/konvajs/konva/0.14.0/konva.min.js"></script> | |
<script type="text/javascript" src="https://rawgit.com/lavrton/react-konva/v1.0.1/dist/react-konva.bundle.js"></script> | |
<script src="http://rawgit.com/mrdoob/stats.js/master/build/stats.min.js"></script> |
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
// app/data/resolvers.js | |
const resolvers = { | |
Query: { | |
... | |
async users() { | |
const users = await User.all() | |
return users.toJSON() | |
}, | |
... |
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
const createLoader = require('../Helpers/loaders/createLoader') | |
/** | |
* Define your loaders here. | |
* Each key should be a valid | |
* instance of DataLoader. | |
*/ | |
const loaders = () => ({ | |
user_group: createLoader('App/Models/UserGroup'), | |
user_personal_data: createLoader('App/Models/PersonalData', 'user_id'), |
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
const DataLoader = require('dataloader') | |
/** | |
* Creates a dataloader for a supplied model. | |
* | |
* @param {String} model e.g. 'App/Models/User' | |
* @param {String} ref_id e.g. 'order_id' | |
* @returns {DataLoader} | |
*/ | |
function createLoader(model, ref_id = 'id', has = 'one') { |
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
//當你需要依照作者列出個人所有的文章時: | |
query Users{ | |
users { | |
id | |
username | |
posts { | |
title | |
description | |
} | |
} |
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
//-----types.graphql | |
type Post { | |
id: Int | |
user_id: Int | |
title: String | |
description: String | |
created_at: Date | |
updated_at: Date | |
} |
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
FROM ubuntu:16.04 | |
# Avoid error messages from apt during image build | |
ARG DEBIAN_FRONTEND=noninteractive | |
RUN \ | |
apt-get update && \ | |
apt-get install -y wget curl gnupg |
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
alias Bootleg.{UI, Config} | |
use Bootleg.DSL | |
# Configure the following roles to match your environment. | |
# `build` defines what remote server your distillery release should be built on. | |
# | |
# Some available options are: | |
# - `user`: ssh username to use for SSH authentication to the role's hosts | |
# - `password`: password to be used for SSH authentication | |
# - `identity`: local path to an identity file that will be used for SSH authentication instead of a password |
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
defmodule Dresser.Worker do | |
@moduledoc "The store, based on `Agent`." | |
def start_link do | |
result = Agent.start_link(fn -> %{} end, name: __MODULE__) | |
__MODULE__.put(:free_dress, 3) | |
result | |
end |
NewerOlder