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
| <button id="btn">ClickMe</button> | |
| <script> | |
| const btn = document.getElementById('btn') | |
| let fileHandle | |
| btn.addEventListener('click', async () => { | |
| [fileHandle] = await window.showOpenFilePicker() | |
| const file = await fileHandle.getFile() | |
| const contents = await file.text() | |
| console.log(contents) | |
| }) |
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
| import { Color, defined, Event, Material, Property } from 'cesium' | |
| const PolylineTrailLinkType = 'PolylineTrailLink' | |
| const PolylineTrailLinkSource = /* glsl */` | |
| czm_material czm_getMaterial(czm_materialInput materialInput) | |
| { | |
| czm_material material = czm_getDefaultMaterial(materialInput); | |
| vec2 st = materialInput.st; |
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
| uniform sampler2D Tex; | |
| const float size = 0.5; | |
| void main(void) | |
| { | |
| vec2 realSize = vec2(textureSize(Tex, 0)); | |
| float ratio = (realSize.x > realSize.y) ? realSize.y/realSize.x : realSize.x/realSize.y; | |
| vec2 texSize = vec2(512., 512.); | |
| vec2 xy = gl_FragCoord.xy; |
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
| with temp_result as ( | |
| select st_point(1, 2) as test_point | |
| ) | |
| select st_asgeojson(test_point) as final_result from temp_result; |
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
| import moment from 'moment' | |
| moment(`2010/1/1 19:20:59.990`, 'YYYY/M/D HH:mm:ss.SSS') | |
| // 解析到的月份是0开头的 |
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 isMobile = /android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent); | |
| if (isMobile) { | |
| location.replace('手机页面'); | |
| } else { | |
| location.replace('PC页面'); | |
| } | |
| /* | |
| 作者:菜鸟码农Java笔记 | |
| 链接:https://www.zhihu.com/question/485560131/answer/2116400654 |
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
| type Point = [number, number, number?] | |
| const isCCW = (p1: Point, p2: Point, p3: Point) => { | |
| return (p2[0] - p1[0]) * (p3[1] - p1[1]) - (p2[1] - p1[1]) * (p3[0] - p1[0]) > 0 | |
| } |
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
| /* 滚动槽 */ | |
| ::-webkit-scrollbar { | |
| width : .5rem; | |
| height: .5rem; | |
| } | |
| ::-webkit-scrollbar-track { | |
| border-radius : .25rem; | |
| background : rgba(0, 0, 0, 0.06); | |
| box-shadow : inset 0 0 .4rem rgba(0, 0, 0, 0.08); |
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
| { | |
| "background": "#1E1F29", | |
| "black": "#000000", | |
| "blue": "#49BAFF", | |
| "brightBlack": "#818181", | |
| "brightBlue": "#49BAFF", | |
| "brightCyan": "#8BE9FE", | |
| "brightGreen": "#50FB7C", | |
| "brightPurple": "#FC4CB4", | |
| "brightRed": "#FC4346", |
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
| uniform vec2 u_resolution; | |
| // 接受一个二维向量,返回一个伪随机值 | |
| float rand(const vec2 seed) { | |
| float t = dot(vec2(12.9898, 78.233), seed); | |
| return fract(sin(t) * (4375.85453 + t)); | |
| } | |
| void main() { | |
| vec2 st = gl_FragCoord.xy / u_resolution.xy; |