Skip to content

Instantly share code, notes, and snippets.

@xinzhi
xinzhi / content.js
Created April 12, 2023 15:20
自动展开显示 Twitter 图片 ALT 文本的扩展脚本,推荐搭配 Arc 浏览器使用
// 1. 打开 Arc 浏览器访问 Twitter 网站;
// 2. 左侧面板右下角点击 New Boost - Inject - A specific website(确认应用范围是 twitter.com)
// 3. 请空默认代码,粘贴本页面代码即可。
// 效果测试地址: https://twitter.com/ciguleva/status/1637233764656107520?s=20
const tweetSelector = 'article[data-testid="tweet"]';
const tweetTextSelector = 'div[data-testid="tweetText"]';
const tweetPhotoSelector = 'div[data-testid^="tweetPhoto"]';
const appendAltText = (tweet, altText) => {
@Julien-Marcou
Julien-Marcou / ecmascript.md
Last active July 11, 2024 20:58
ECMAScript Support

ECMAScript Support (as of October 29, 2022)

Global support of es2023 since:

  • Chrome v97 (January 4, 2022)
  • Edge v97 (December 1, 2021)
  • Safari v15.4 (March 14, 2022)
  • Safari on iOS v15.4 (March 14, 2022)
  • Opera v83 (January 19, 2022)
  • Firefox v104 (June 23, 2022)
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {

The Composable Architecture (可组装架构)

The Composable Architecture (简写为TCA) 让你用统一、便于理解的方式来搭建应用程序,它兼顾了组装,测试,以及功效。你可以在 SwiftUI,UIKit,以及其他框架,和任何苹果的平台(iOS、macOS、tvOS、和 watchOS)上使用 TCA。

@brennanMKE
brennanMKE / IDETemplateMacros.plist
Last active May 17, 2024 05:36
Xcode File Header Templates
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string>
// Copyright © ___YEAR___ ___ORGANIZATIONNAME___.
// All Rights Reserved.
</string>
<key>ORGANIZATIONNAME</key>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleIdentifier</key>
<string>com.YourName.YourAppName</string>
<key>CFBundleVersion</key>
<string>1</string>
@davidteren
davidteren / nerd_fonts.md
Last active July 12, 2024 21:14
Install Nerd Fonts via Homebrew [updated & fixed]
@hdsenevi
hdsenevi / Podfile
Created January 22, 2019 19:17
Podfile that has an issue in it
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
install! 'cocoapods', :deterministic_uuids => false
target 'OUR_PROJECT_NAME' do
pod 'AppCenter/Crashes', '~> 1.9.0'
pod 'AppCenter/Analytics', '~> 1.9.0'
pod 'AppCenterReactNativeShared', '~> 1.8.1'
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
// 終點座標
let targetCoordinate = self.targetLocation.coordinate
// 初始化 MKPlacemark
let targetPlacemark = MKPlacemark(coordinate: targetCoordinate)
// 透過 targetPlacemark 初始化一個 MKMapItem
let targetItem = MKMapItem(placemark: targetPlacemark)
// 使用當前使用者當前座標初始化 MKMapItem
let userMapItem = MKMapItem.forCurrentLocation()
// 建立導航路線的起點及終點 MKMapItem
let routes = [userMapItem,targetItem]
@kevenbauke
kevenbauke / wkwebview_links_externally.swift
Last active June 21, 2022 17:13
WKWebView open links in Safari