Skip to content

Instantly share code, notes, and snippets.

View oaooao's full-sized avatar
🎯
Focusing

陆伟 oaooao

🎯
Focusing
  • 上海/徐汇
View GitHub Profile
@oaooao
oaooao / GeolocationAPI.md
Last active July 6, 2022 09:53
Geolocation是HTML5标准下的一个Web API

Geolocation是HTML5标准下的一个Web API,利用它可以获取设备的当前位置信息(坐标),此API具有三个方法:getCurrentPosition、watchPosition和clearWatch,其中最常用的是getCurrentPosition方法,剩下两个方法需要搭配使用!

使用方法:

  1. 浏览器兼容性检测:

该api通过navigator.geolocation对象发布,只有在此对象存在的情况下,才可以使用它的地理定位服务,检测方法如下:

@oaooao
oaooao / machine.js
Last active November 12, 2019 05:15
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@oaooao
oaooao / ID.json
Last active October 28, 2021 12:45
{
"ruleType": "COMMON_RULE",
"operator": "IN",
"rules": [
// 左值
{
"ruleType": "FIELD",
"fieldName": "memberId",
"array": false,
"dataType": "Selector",
@oaooao
oaooao / global.js
Created January 20, 2022 09:15
emotion-react-global.js
// @flow
import * as React from 'react'
import { withEmotionCache } from './context'
import { ThemeContext } from './theming'
import { insertStyles } from '@emotion/utils'
import { isBrowser } from './utils'
import { StyleSheet } from '@emotion/sheet'
import { serializeStyles } from '@emotion/serialize'
@oaooao
oaooao / script module.md
Last active July 6, 2022 10:17
script 脚本的 module 用法如何兼容旧版浏览器

type="module" 的浏览器兼容

我们可以使用 nomodule 特性来提供一个 fallback:

<!-- 为现代浏览器提供 es module 格式的代码 -->
<script type="module" src="app.esm_c9a6fe.js"></script>
<!-- 为旧版浏览器提供经典格式的js代码 -->
<script nomodule src="app.f7d631.js"></script>
@oaooao
oaooao / npm clean.md
Last active July 14, 2022 02:38
NPM Clean

NPM Clean - Needed if SHA1 hashes are appearing

npm cache clear --force
rm -r node_modules/
rm package-lock.json
npm install
@oaooao
oaooao / privacy-policy.md
Created April 2, 2025 05:29
Privacy Policy for URL Lens GPT

Privacy Policy for URL Lens GPT Action

Last updated: 2025-04-02

This privacy policy explains how the URL Lens API (the backend service used by the URL Lens GPT) handles data when you use the GPT.

  1. Data Received: When you provide a URL to the URL Lens GPT, that URL is sent to our backend API hosted on Vercel for processing. No other personal information is sent.

  2. Data Processing: The API fetches the content from the provided URL solely for the purpose of parsing it (extracting title, summary, text, etc.) to return the results back to the GPT and then to you.

@oaooao
oaooao / json
Created April 5, 2025 08:17
roo code schema
{}