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
<!-- ./app/views/posts/_form.html.erb --> | |
<div class="form-group mb-3"> | |
<%= content_fields.label :body, class: 'col-form-label' %> | |
<div data-controller="quill-editor"> | |
<div data-target="quill-editor.container" style="min-height: 250px;"></div> | |
<%= content_fields.text_area :body, class: 'form-control d-none', placeholder: 'Content' %> | |
</div> | |
</div> |
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
// package.json | |
{ | |
"name": "webpack-sandbox", | |
"sideEffects": false, | |
"version": "1.0.0", | |
"description": "", | |
"private": true, | |
"scripts": { | |
"build": "webpack -p", | |
"watch": "webpack --watch", // 當檔案有變更時會重 build |
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
/* eslint-disable */ | |
const request = require('request') | |
const cheerio = require('cheerio') | |
const async = require('async') | |
const path = require('path') | |
const fse = require('fs-extra') | |
let getLocationURL = 'https://event.moc.gov.tw/' | |
let pageSize = '100' |
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
/** | |
* 利用 validate function 可以驗證 object 中的必填欄位有無填寫 | |
**/ | |
// object validation rules | |
const schema = { | |
firstName: { | |
required:true | |
}, | |
lastName: { |
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 = window.superagent; | |
const root = "https://jsonplaceholder.typicode.com"; | |
const postVm = new Vue({ | |
el: "#post", | |
data: { | |
post: { | |
userId: "", | |
id: "", | |
title: "" |
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
// ./node_modules/passport/lib/middleware/authenticate.js | |
/** | |
* Module dependencies. | |
*/ | |
var http = require('http'), | |
IncomingMessageExt = require('../http/request'), | |
AuthenticationError = require('../errors/authenticationerror') | |
/** |
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
let obj = { | |
name: 'Aaron Chen', | |
greet: function () { | |
console.log(`Hello ${this.name}`) | |
} | |
} | |
obj.greet() | |
obj.greet.call({name: 'Andy Chang'}) |