Skip to content

Instantly share code, notes, and snippets.

View rc1021's full-sized avatar
🏠
Working from home

許益銘 rc1021

🏠
Working from home
View GitHub Profile
@rc1021
rc1021 / auto-tag-after-pr.yml
Created February 1, 2024 00:58
PR 合併後自動新增版本號
name: Create Version Tag on PR Merge
on:
pull_request:
types:
- closed
jobs:
create_tag:
runs-on: ubuntu-latest
@rc1021
rc1021 / app.js
Last active March 28, 2022 07:39
變更 resources/js/app.js 以符合 vue3 規格
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
// window.Vue = require('vue').default;
// 改為
@rc1021
rc1021 / update-vue3.sh
Last active March 28, 2022 07:23
升級 Vue 3
npm install -D vue@next
npm install -D @vue/compiler-sfc
npm install vue-loader@^16.2.0 --save-dev --legacy-peer-deps
npm run dev
@rc1021
rc1021 / gist:08c777de74407ab69f4e7b487b1e91bc
Created March 28, 2022 07:11
laravel/ui 初始化 vue 相關目錄和變更一些檔案
demo-app
|- resources
| |- js
| | |- components
| | |- ExampleComponent.vue
| |- app.js
|- package.json // 加入 vue, vue-loader, vue-template-compiler
|- webpack.mix.js // 加入 .vue()
@rc1021
rc1021 / install-with-vue2.sh
Last active March 28, 2022 07:21
新增 Laravel 專案 with Vue2
composer create-project laravel/laravel demo-app "8.6.11"
cd demo-app
composer require laravel/ui --dev
php artisan ui vue
@rc1021
rc1021 / install-docker.md
Created March 22, 2021 13:04 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@rc1021
rc1021 / getall.sh
Created January 20, 2021 02:53
获取所有币信息 (USER_DATA)
#!/usr/bin/env bash
# Set up authentication:
# apiUrl="https://testnet.binance.vision"
apiUrl="https://api.binance.com"
apiKey=""
secretKey=""
# Set up the request:
apiMethod="GET"
@rc1021
rc1021 / Remove all git tags
Created November 20, 2020 07:11 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
input {
beats {
port => "5044"
}
}
filter {
## Ignore the comments that IIS will add to the start of the W3C logs
#
if [message] =~ "^#" {

Querying JSON with SelectToken and Linq Descendants

使用 Newtonsoft 的 SelectToken 取得 Path 節點的內容值,以及 Descendants 拜訪節點

以下的範例我們將使用這個 Json 結構進行說明

JObject o = JObject.Parse(@"{
  'Stores': [
    'Lambton Quay',
 'Willis Street'