This file contains hidden or 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
// https://hamisme.blogspot.com/2019/11/taiko.html | |
const { closeBrowser, openBrowser, goto, write, click, $, into} = require('taiko'); | |
(async () => { | |
try { | |
await openBrowser(); | |
await goto("www.591.com.tw/"); | |
await click($("#area-box-close")); | |
await click("租屋"); | |
await click("10000-20000元"); // 選擇租金範圍 | |
await click("2房"); // 選擇格局 |
This file contains hidden or 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 std::net::{SocketAddr, TcpStream}; | |
fn ping(addrs: SocketAddr) { | |
if let Ok(_stream) = TcpStream::connect(&addrs) { | |
println!("Connected to the server!"); | |
} else { | |
println!("Couldn't connect to server..."); | |
} | |
} |
This file contains hidden or 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
func twoSum(nums []int, target int) []int { | |
// First 36ms | |
// var count = len(nums) | |
// first := 1 | |
// for idx, num := range nums { | |
// for i := first; i < count; i++ { | |
// if num+nums[i] == target { | |
// return []int{idx, i} | |
// } |
This file contains hidden or 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 enum_example | |
import ( | |
"bytes" | |
"encoding/json" | |
) | |
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred | |
type TaskState int |
This file contains hidden or 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 puppeteer = require('puppeteer'); | |
(async() => { | |
const browser = await puppeteer.launch({slowMo: 500}); | |
const page = await browser.newPage(); | |
await page.goto('https://open.shopee.com/documents/'); | |
// await page.screenshot({path: 'example.png'}); | |
const datas = await page.evaluate(() => { | |
var x1 = document.querySelectorAll("ul.el-menu li.el-submenu"); |
This file contains hidden or 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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains hidden or 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
<targets async="true"> | |
<default-wrapper xsi:type="AsyncWrapper"> | |
<wrapper xsi:type="RetryingWrapper"/> | |
</default-wrapper> | |
.......... | |
</targets> |
This file contains hidden or 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
<div class="container"> | |
<div id="example"> | |
<div> | |
<label> Length </label> | |
<input v-model="vLength"> | |
</div> | |
<div> | |
<label> Width </label> | |
<input v-model="vWidth"> | |
</div> |
This file contains hidden or 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
<div class="container"> | |
<div id="example"> | |
<ul class="list-group" v-for="data in inputData"> | |
<v-input-text :value.sync="data" | |
regx-msg="請輸入數字正確格式" | |
regx="^[0-9]+$" | |
placeholder="input you text" | |
has-button="true" | |
button-word="檢查" | |
:button-event="test"/> |
This file contains hidden or 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
FROM microsoft/dotnet:2.0.5-runtime-stretch AS base | |
WORKDIR /app | |
ARG projectName=app | |
FROM microsoft/dotnet:2.0.5-sdk-2.1.4-stretch AS build | |
WORKDIR /src | |
# COPY *.sln ./ | |
COPY app/app.csproj app/ | |
# RUN dotnet restore |