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
'use strict'; | |
const DataLoader = require('dataloader'); | |
class Service { | |
constructor({ BaseService, options }) { | |
this.id = BaseService.id || 'id'; | |
this.service = BaseService; | |
this.dataloader = new DataLoader(this._batchGet.bind(this), options); |
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 request = require('request-promise'); | |
const errors = require('feathers-errors'); | |
const options = { | |
idField: 'sub', | |
issuer: 'iss' | |
}; | |
module.exports = function() { |
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
{ | |
"Version":"2008-10-17", | |
"Id":"http referer policy example", | |
"Statement":[ | |
{ | |
"Sid":"Allow get requests referred by www.mysite.com and mysite.com", | |
"Effect":"Allow", | |
"Principal":"*", | |
"Action":"s3:GetObject", | |
"Resource":"arn:aws:s3:::YOUR_S3_BUCKET_NAME/*", |
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 template = generateTemplateString("Xin chào ${map.name}, tuổi con ${age}."); | |
console.log(template({ | |
name: 'None use', | |
age: 'chó', | |
map: { | |
name: 'Trần Minh Giàu', | |
} | |
})); |
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 { | |
GraphQLEnumType, | |
GraphQLObjectType, | |
GraphQLFloat, | |
GraphQLID, | |
GraphQLNonNull, | |
GraphQLString, | |
} = require('graphql'); | |
const { | |
globalIdField, |
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 { | |
GraphQLObjectType, | |
} = require('graphql'); | |
const { | |
fromGlobalId, | |
nodeDefinitions, | |
} = require('graphql-relay'); | |
const modelsRegistry = {}; |
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 { | |
GraphQLObjectType, | |
} = require('graphql'); | |
const { | |
fromGlobalId, | |
nodeDefinitions, | |
} = require('graphql-relay'); | |
const modelsRegistry = {}; |
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
(function () { | |
var reportn = [{},{},{},{},{},{},{}]; | |
var gamesCount = 1; | |
function resultNumber(jResultNumber) { | |
var sorted = jResultNumber.find('li:not(.arrow-result)').toArray().map(function (el) { | |
return el.innerHTML.toString(); | |
}).sort(); | |
[1,2,3,4,5,6].forEach(l => [0,1,2,3,4,5].forEach(i => { | |
if (l > i) { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Basic Example with JSX</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.css" /> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/components/input.css"/> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/components/table.css"/> | |
</head> | |
<body> |
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
Validation.add('validate-date-range', '', function (value, elem) { | |
var match = elem.id.match(/^(.+)-(from|to)-(date|time)$/); | |
if (match) { | |
var fromDate = jQuery('#' + match[1] + '-from-date'); | |
if (match[3] === 'date') { | |
if (fromDate.val() > value) { | |
this.error = 'Giá trị cần phải lớn hơn hoặc bằng ' + fromDate.val(); | |
return false; | |
} | |
} else { |