Skip to content

Instantly share code, notes, and snippets.

PJCHENder PJCHENder

Block or report user

Report or block PJCHENder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sunrise-sunset.json
This file has been truncated, but you can view the full file.
[
{
"locationName": "臺北",
"time": [
{
"dataTime": "2019-10-09",
"sunrise": "05:49:00",
"sunset": "17:33:00"
},
View FieldArray.js
/* demo use for array of objects with formik */
import React from 'react';
import { Formik, Field, Form, FieldArray, ErrorMessage } from 'formik';
import Debug from './Debug';
// import * as Yup from 'yup';
// STEP 1: 定義 initialValues
const initialValues = {
friends: [
{
@PJCHENder
PJCHENder / 安裝並啟動 Rails 專案.md
Created May 10, 2019
安裝並啟動 Rails 專案.md
View 安裝並啟動 Rails 專案.md

title: "[Rails] 安裝並啟動 Rails 專案" date: 2019-05-09 10:10:10 updated: 2019-05-09 10:10:10 categories:

  • Ruby on Rails tags:
  • rails
  • rvm
  • gem
View AdminQuotationForm.diff
diff --git a/src/components/AdminQuotationForm.js b/src/components/AdminQuotationForm.js
index 3c3e836..3943673 100644
--- a/src/components/AdminQuotationForm.js
+++ b/src/components/AdminQuotationForm.js
@@ -269,18 +269,21 @@ class AdminQuotationForm extends React.Component {
}
const {
- quoteExpireAt, quoteStartAt, items, explanations, ...rest
+ quoteExpireAt, quoteStartAt, items, explanations, timezone, ...rest
View drive.js
/* eslint-disable */
import React from 'react';
import { Avatar, Button } from 'antd';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import styled, { ThemeProvider } from 'styled-components';
/* utils */
import { btnReboot, btnHoverTransparentToMajor } from '@/vendor/style-utils';
@PJCHENder
PJCHENder / messages.json
Last active Dec 26, 2018
Wavbo Messages
View messages.json
{
"bulletinMessages": [
"在非洲,每六十秒,就有一分鐘過去",
"凡是每天喝水的人,有高機率在 100 年內死去",
"每呼吸 60 秒,就減少一分鐘的壽命",
"誰能想的到,這名 16 歲少女,在四年前,只是一名 12 歲少女",
"台灣人在睡覺時,大多數的美國人都在工作",
"當蝴蝶在南半球拍了兩下翅膀,牠就會稍微飛高一點點",
"據統計,未婚生子的人數中有高機率為女性",
"只要每天省下買一杯奶茶的錢,十天後就能買十杯奶茶",
@PJCHENder
PJCHENder / advanced_this.js
Last active Aug 8, 2018
[AC] What is this?
View advanced_this.js
let alphaPhoneX = {
name: 'AlphaPhoneX',
price: 14999,
features: ['long battery life', 'AI camera'],
showPhoneInfo: function () {
console.log('this now refers to', this)
console.log(`The price of ${this.name} is $${this.price}`)
}
}
@PJCHENder
PJCHENder / create object.js
Last active Aug 8, 2018
[AC] Object creating and constructor function
View create object.js
let alphaPhoneX = {
name: 'AlphaPhoneX', // String
price: 14999, // Number
features: ['long battery life', 'AI camera'], // Array
showSpec: function() { // Function
console.log('show the spec of the phone')
},
hardware: { // Object
ram: '8GB',
storage: '64GB'
@PJCHENder
PJCHENder / MDN 上的範例.js
Last active Aug 10, 2018
[AC] constructor function and prototypal inheritance
View MDN 上的範例.js
function Person(name, interests) {
this.name = name;
this.interests = interests;
};
Person.prototype.greeting = function() {
console.log(`Hi! I'm ${this.name}.`);
};
function Teacher(name, interests, subject) {
@PJCHENder
PJCHENder / Async Await 基本使用.js
Last active Jul 30, 2018
Promise and Async/Await Example
View Async Await 基本使用.js
// async function 本身會回傳 Promise,
// 因此 async function 之後也可以用 `.then()` 串起來
main().then(value => {
console.log(value);
});
async function main () {
console.log('start fn') // STEP 1-1
let val = await get() // STEP 1-2
You can’t perform that action at this time.