Skip to content

Instantly share code, notes, and snippets.

View thiskevinwang's full-sized avatar

Kevin Wang thiskevinwang

View GitHub Profile
@thiskevinwang
thiskevinwang / gist:4849b33642d527b7262cc4fb285792a1
Created August 15, 2022 23:07
k logs pod/waypoint-task-01gahvzed9y3jgc6wdh3y81fbm-89khk
2022-08-15T23:03:49.581Z [INFO] waypoint: waypoint version: full_string="v0.9.0-374-g8b1c06ff2 (8b1c06ff2+CHANGES)" version=v0.9.0-374-g8b1c06ff2 prerelease="" metadata="" revision=8b1c06ff2+CHANGES
2022-08-15T23:03:49.582Z [DEBUG] waypoint: home configuration directory: path=/root/.config/waypoint
2022-08-15T23:03:49.582Z [INFO] waypoint.server: attempting to source credentials and connect
2022-08-15T23:03:49.584Z [DEBUG] waypoint.serverclient: connection information: address=REDACTED:9701 tls=true tls_skip_verify=true send_auth=true has_token=true
2022-08-15T23:03:49.663Z [DEBUG] waypoint.server: connection established with sourced credentials
2022-08-15T23:03:49.665Z [INFO] waypoint: server version info: version=v0.9.0-374-g8b1c06ff2 api_min=1 api_current=1 entrypoint_min=1 entrypoint_current=1
2022-08-15T23:03:49.665Z [INFO] waypoint: negotiated api version: version=1
2022-08-15T23:03:49.665Z [INFO] waypoint.runner.agent: sourcing credentials and connecting to the Waypoint server
2022-08-15T23:03:49.
@thiskevinwang
thiskevinwang / yunmai_protocol.txt
Created June 7, 2022 05:53 — forked from pwnall/yunmai_protocol.txt
Yunmai smart scale (M1301, M1302, M1303) Bluetooth LE protocol notes
Yunmai smart scale (M1301, M1302, M1303) Bluetooth LE protocol notes
Commands are written to GATT attribute 0xffe9 of service 0xffe5. Responses come
as value change notifications for GATT attribute 0xffe4 of service 0xffe0. These
are 16-bit Bluetooth LE UUIDs, so nnnn is 0000nnnn-0000-1000-8000-00805F9B34FB.
-----
Packet Structure
@thiskevinwang
thiskevinwang / README.md
Last active May 18, 2022 14:08
Script for migrating images, MDX and nav-data files
@thiskevinwang
thiskevinwang / 1_screenshot.md
Last active December 26, 2021 00:11
MDX to JSX to SWC

Screen Shot 2021-12-25 at 7 09 40 PM

{"requestedUrl":"https://thekevinwang.com/","finalUrl":"https://thekevinwang.com/","lighthouseVersion":"9.0.0","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/95.0.4638.69 Safari/537.36","fetchTime":"2021-11-20T23:24:52.328Z","environment":{"networkUserAgent":"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4695.0 Mobile Safari/537.36 Chrome-Lighthouse","hostUserAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/95.0.4638.69 Safari/537.36","benchmarkIndex":1087},"runWarnings":[],"configSettings":{"emulatedFormFactor":"mobile","formFactor":"mobile","locale":"en-US","onlyCategories":["performance","accessibility","best-practices","seo"],"channel":"lr"},"audits":{"form-field-multiple-labels":{"id":"form-field-multiple-labels","title":"No form fields have multiple labels","description":"Form fields with multiple labels can be confusingly announced by assistive technologies
{"requestedUrl":"https://thekevinwang.com/","finalUrl":"https://thekevinwang.com/","lighthouseVersion":"9.0.0","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/95.0.4638.69 Safari/537.36","fetchTime":"2021-11-20T19:53:59.857Z","environment":{"networkUserAgent":"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4695.0 Mobile Safari/537.36 Chrome-Lighthouse","hostUserAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/95.0.4638.69 Safari/537.36","benchmarkIndex":1147.5},"runWarnings":[],"configSettings":{"emulatedFormFactor":"mobile","formFactor":"mobile","locale":"en-US","onlyCategories":["performance","accessibility","best-practices","seo"],"channel":"lr"},"audits":{"dom-size":{"id":"dom-size","title":"Avoids an excessive DOM size","description":"A large DOM will increase memory usage, cause longer [style calculations](https://developers.google.com/web/fundamentals/performa
@thiskevinwang
thiskevinwang / exchanging_messages.rs
Created October 22, 2020 03:03
lowlvl.org / tcp-ip-fundamentals / exchanging-messages
// ----------------------------------------------------------
// https://lowlvl.org/tcp-ip-fundamentals/exchanging-messages
// ----------------------------------------------------------
// Write your code here.
let socket = UdpSocket::bind("10.0.0.1:1000").expect("couldn't bind to address");
// SEND TO NAME SERVER
socket
.send_to(b"Alice", "1.2.3.4:53")
@thiskevinwang
thiskevinwang / .rust_snippets.md
Last active July 3, 2020 23:29
Rust Snippets!

created: [2020-05-31]

TODO

  • Version control gists?
  • Modify gists from CLI or IDE

Leetcode

@thiskevinwang
thiskevinwang / Tic-Tac-Toe-6.jsx
Last active June 8, 2024 03:19
Solution to Task #6 (ALL TASKS)
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
function Square(props) {
return (
<button
className={"square " + (props.isWinning ? "square--winning" : null)}
onClick={props.onClick}
>
// inside Game component's render() call
let status;
if (winner) {
status = "Winner: " + winner.player + " @ " + winner.line;
} else if (!current.squares.includes(null)) {
status = "draw";
} else {
status = "Next player: " + (this.state.xIsNext ? "X" : "O");
}