Skip to content

Instantly share code, notes, and snippets.

@CarsonSlovoka
CarsonSlovoka / demo.md
Created April 30, 2024 06:23
lng, lat, r在一個經緯度的位置,顯示半徑r的圓圈

image

Country, Language, Total, Has Ranking, CI Build Ok, Total %, Has Ranking %, CI Build Ok %
Global, All, 2520, 2405, 2027, 100,00 %, 100,00 %, 100,00 %
Global, Java, 551, 526, 458, 21,87 %, 21,87 %, 22,59 %
Global, Python, 525, 505, 446, 20,83 %, 21,00 %, 22,00 %
Global, C# / Mono, 334, 319, 290, 13,25 %, 13,26 %, 14,31 %
Global, JavaScript, 251, 235, 211, 9,96 %, 9,77 %, 10,41 %
Global, C++, 184, 183, 152, 7,30 %, 7,61 %, 7,50 %
Global, C, 141, 127, 113, 5,60 %, 5,28 %, 5,57 %
Global, Ruby, 98, 95, 81, 3,89 %, 3,95 %, 4,00 %
@CarsonSlovoka
CarsonSlovoka / ref-carson-carousel.html
Last active October 25, 2023 10:44
carousel component
@CarsonSlovoka
CarsonSlovoka / Carousel.html
Last active October 24, 2023 03:03
Carousel 旋轉木馬
@CarsonSlovoka
CarsonSlovoka / foramt_date_array.js
Created September 28, 2023 04:11
給定一個元素都為yyyy/mm/dd的array,將其連續的日期使用`${start}-{end}`的方式串在一起
<script>
function formatDateRange(dateArray) {
if (dateArray.length < 2) {
return dateArray
}
const result = dateArray.reduce((acc, curDateStr, index, array) => {
const curDate = new Date(curDateStr)
if (acc.rangeEnd && curDate === acc.rangeEnd) {
@CarsonSlovoka
CarsonSlovoka / calendar.js
Last active September 28, 2023 07:54
example: simple calendar (js)
/**
* @typedef {Object} CalendarOptions
* @property {function(Calendar): void} execute
*/
/**
* @typedef {Object} StyleOptions
* @property {(style: Object)=>{}} execute
*/
@CarsonSlovoka
CarsonSlovoka / calendar.html
Last active September 27, 2023 11:23
example: simple calendar (class)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vote</title>
</head>
<body>
<form action="/vote/" method="post">
@CarsonSlovoka
CarsonSlovoka / calendar.html
Last active September 27, 2023 11:22
example: simple calendar
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vote</title>
<style>
#calendar {
display: none;
position: absolute;
@CarsonSlovoka
CarsonSlovoka / demo.go
Created September 26, 2023 03:56
re-run slash command by button
/*
USAGE:
-guild=987654321987654321 -token=xxxxx.oooo -rmcmd=true
腳本說明:
當使用者輸入 `/joke` 指令,可以選擇要看哪一則笑話(由chatgpt所提供),
看完之後會出現一個按鈕,可以查看下一則笑話(已經到尾就再從頭開始)
*/
package main
@CarsonSlovoka
CarsonSlovoka / markMap.vue
Last active August 25, 2023 02:32
slidev component: markMap
<!--
Usage:
<markMap>
<pre>
Root
group1
sub1
<a href=''>sub2</a>
msg
hello <span class="green">world</span>