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 { performance } = require('perf_hooks'); | |
// 前端為 `window.performance` | |
// 後端為 `const { performance } = require('perf_hooks');` | |
const func = (n) => { | |
return ((1 + n) * n) / 2; | |
}; | |
const start = performance.now(); | |
func(1000000); |
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
/*jshint node: true, esversion: 9 */ | |
const mqtt = require('mqtt'); | |
const client = mqtt.connect('mqtt://your_mqtt_server'); | |
const audio = require('win-audio').speaker; | |
client.on('connect', () => { | |
client.subscribe('increase/volume/inTopic'); | |
}); | |
client.on('message', (topic, message) => { |
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
#include <Servo.h> | |
Servo servo; | |
byte digit = 0; // 目前數字 0~9 | |
byte buttonState = 0; // 按鈕狀態 | |
byte lastButtonState = 0; // 按鈕最後狀態 | |
byte speed = 90; // 速度 | |
byte speedState = 10; // 速度段數,預設 10 靜止 | |
byte speedDirection = 1; // 方向 |
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
<span style="font-family: MS Pゴシック"> | |
―_ .///// /// /// ///三三三三三≡≡≡≡≡≡/.==<br /> | |
 ̄―/////―_ /// /// /// /三三三三三≡≡≡≡ /Ο =<br /> | |
.///// ̄―二///―_/// /// /// 三三三三三≡≡≡/ ====<br /> | |
///// /// ̄―///二///_///〃〃 ヽ ヽ.| ._____|0 ====<br /> | |
. ///// /// /// ///―///〃〃 ヽ ヽ| |///|======<br /> | |
///// /// /// /// ///〃〃ヽ ヽ .| |///|======<br /> | |
////三三三///三三///三///三///〃 .木 木 木 木 . | |///|======<br /> | |
/// /// ///_///―///〃〃木 木 木 木. _| |///|======<br /> | |
// ///_―///三三三== ̄ | __口_口_口_口/三三三|======<br /> |
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 shortUrl32 = (url) => { | |
const _alphabet = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ'; // 排除相似字 01OI // 共 32 個字 | |
const _base = _alphabet.length - 1; | |
const hash = CryptoJS.MD5(url).toString(); | |
const hashLen = hash.length; | |
let i = 0; | |
let j = 0; | |
let codes = []; | |
// 生成的 32 個位數,使用 8位數 x 4組 = 32 位數 | |
for (i = 0; i < 4; i++) { |
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 defaultState = { | |
code: null, | |
data: null, | |
total: null, | |
}; | |
const Regions = ({ ...props }) => { | |
const [{ code, data }, setState] = useState(defaultState); | |
useEffect(() => { | |
let canceled = false; |
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
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\Support\Facades\Schema; // [20191110] For mariadb (By QQBoxy) | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** |
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
#天氣 | |
get-appxpackage *BingWeather* | remove-appxpackage | |
#取得協助 | |
get-appxpackage *GetHelp* | remove-appxpackage | |
#Microsoft 提示 | |
get-appxpackage *Getstarted* | remove-appxpackage | |
#HEIF 擴充功能 | |
get-appxpackage *HEIF* | remove-appxpackage | |
#Microsoft 訊息中心 | |
get-appxpackage *Messaging* | remove-appxpackage |
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
<div> | |
Input: | |
<br /> | |
<textarea id="rowdata" cols="40" rows="10" onclick="select()"></textarea> | |
</div> | |
<div> | |
Output: | |
<br /> | |
<textarea id="newdata" cols="40" rows="10" onclick="select()"></textarea> | |
</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
/************************************************** | |
File: File.js | |
Name: File | |
Explain: File | |
****************************************By QQBoxy*/ | |
/*jshint node: true, esversion: 6 */ | |
'use strict'; | |
import React from 'react'; | |
import { Form, Button, Upload, Icon, DatePicker, message } from 'antd'; |
NewerOlder