Skip to content

Instantly share code, notes, and snippets.

@pjchender
pjchender / index.html
Last active Jul 2, 2020
movie-vue-create
View index.html
<div id="app">
<!-- navigation -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="./index.html">Movie List</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
@pjchender
pjchender / RadioButtonForm.js
Created Feb 24, 2020
React Formik with RadioGroup
View RadioButtonForm.js
import React from 'react';
import { Formik, Form, useField } from 'formik';
const GENDERS = [
{
name: 'other',
value: 0,
},
{
name: 'male',
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'
You can’t perform that action at this time.