This library is now deprecated in favour of a more complete and SwiftUI friendly TextEditor backport:
https://github.com/shaps80/SwiftUIBackports
See it in action here: https://twitter.com/shaps/status/1654972428286668800?s=20
| const MY_DOMAIN = "agodrich.com" | |
| const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2" | |
| const DISQUS_SHORTNAME = "agodrich" | |
| addEventListener('fetch', event => { | |
| event.respondWith(fetchAndApply(event.request)) | |
| }) | |
| const corsHeaders = { | |
| "Access-Control-Allow-Origin": "*", |
This library is now deprecated in favour of a more complete and SwiftUI friendly TextEditor backport:
https://github.com/shaps80/SwiftUIBackports
See it in action here: https://twitter.com/shaps/status/1654972428286668800?s=20
提起 WebAssembly/Wasm 可能会想起它是一种可以在浏览器里运行 C/C++/Rust 的技术,实际上它是一个虚拟机标准,它的实现可以在 MCU(单片机)、移动设备、桌面电脑到服务器里面跑,可以嵌入到浏览器、嵌入到应用程序或者独立运行,没有具体的边界。
特点:
| #!/bin/sh | |
| fl () { | |
| API="https://flomoapp.com/iwh/xxxxxxx/" # substitute with your flomo API | |
| curl -s -H "Accept: application/json" -H "Content-type: application/json" -s -X POST $API -d '{"content":"'"$*"'"}' | |
| } |
| // | |
| // VirtualKeyboard.swift | |
| // MacBook Air M1 Zhuyin Keyboard | |
| // Written with SwiftUI ~=300 LOC, < 4hrs | |
| // Created by Ethan Huang on 2021/1/13. | |
| // Twitter: @ethanhuang13 | |
| import SwiftUI | |
| struct VirtualKeyboard: View { |
| import SwiftUI | |
| import PlaygroundSupport | |
| struct ClickWheel: View { | |
| var body: some View { | |
| ZStack { | |
| Circle() | |
| .fill(LinearGradient( | |
| gradient: Gradient(stops: [ | |
| .init(color: Color(#colorLiteral(red: 0.21568627655506134, green: 0.21568627655506134, blue: 0.21568627655506134, alpha: 1)), location: 0), |
| cd $path | |
| DATE=`date -v-6d +"%Y-%m-%d"` | |
| AUTHOR=`git config user.name` | |
| LOG=`git log --branches --pretty=format:"\n%ad: %s" --date=short --after=$DATE --author="$AUTHOR"` | |
| CHANGES=`git log --branches --date=short --after=$DATE --author="$AUTHOR" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "本周贡献代码: +%s行, -%s行, 总行数: %s\n", add, subs, loc }' -` | |
| WEEKSTART=`date -v"monday" +"%-m月%d"` | |
| TODAY=`date +"%-m月%d"` | |
| REPORT="【周报】$WEEKSTART ~ $TODAY \n\n$CHANGES\n$LOG\n" |
A JSON compilation database is a very handy output format which is parsed and used by many development tools. Unfortunately for us Apple Developers, it is not straightforward to generate one from within Xcode, as it is (probably) not Apple's priority and therefore there is no toggle/switch/setting that can be easily enabled to get this information.
There is however a solution, thanks to Apple using Clang/LLVM as their main toolchain.
The standard way to generate this with clang would be to use the -MJ flag and give it a file name that typically corresponds to the input file. Using this flag indirectly through Xcode is hard, given that we're not aware of all the other arguments when a compiler call is executed.
However, there is a second hidden/badly documented LLVM flag: -gen-cdb-fragment-path - it is implemented in terms of -MJ and has the same functionality, but it's argument in contrast is an output directory.
| import Foundation | |
| import TabularData | |
| /// OpenStep 格式 Property List 工具集。 | |
| /// | |
| /// OpenStep 格式 Property List 也称 ASCII Property List 或旧版 Property List。 | |
| public enum OldStylePropertyList { | |
| // MARK: Property List | |
| /// 将 `String` (`NSString`) 转为 OpenStep Property List 输出格式。 |
| .global _main | |
| .extern _putchar | |
| .align 4 | |
| _main: | |
| ; prolog; save fp,lr,x19 | |
| stp x29, x30, [sp, #-0x20]! | |
| str x19, [sp, #0x10] |