Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
jq at the Shortcuts
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
cockscomb
December 22, 2022
Programming
1
2k
jq at the Shortcuts
Presented @ potatotips#80
cockscomb
December 22, 2022
Tweet
Share
More Decks by cockscomb
See All by cockscomb
GraphQL放談
cockscomb
4
2.1k
GraphQL Highway
cockscomb
28
8.7k
吉田を支える技術
cockscomb
0
2.5k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.4k
ユーザインターフェイスと非同期処理
cockscomb
5
2k
GUIアプリケーションの構造と設計
cockscomb
10
10k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.7k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.6k
iOSアプリエンジニアのためのAndroidアプリ開発
cockscomb
7
2k
Other Decks in Programming
See All in Programming
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
1k
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
230
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
130
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
300
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
340
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
600
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
150
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
210
20260315 AWSなんもわからん🥲
chiilog
2
160
Docコメントで始める簡単ガードレール
keisukeikeda
1
120
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
150
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.1k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
GitHub's CSS Performance
jonrohan
1032
470k
How to make the Groovebox
asonas
2
2k
Marketing to machines
jonoalderson
1
5k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
88
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
320
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
380
Test your architecture with Archunit
thirion
1
2.2k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.1k
Transcript
.app jq
id:cockscomb
jq
jq stedolan.github.io/jq/ $ echo '{"foo": "bar"}' | jq '.foo' "bar"
gh Scripting with GitHub CLI | The GitHub Blog $
gh api ... -- jq '.[].login' # = > "user1" # = > "user2" # = > ...
jq JSON
.app
URL
None
jq
Swift jq
gojq itchyny/gojq: Pure Go implementation of jq
golang.org/x/mobile
package binding import ( "github.com/itchyny/gojq" _ "golang.org/x/mobile/bind" ) type Query
struct { query *gojq.Query } func NewQuery(src string) (*Query, error) { query, err := gojq.Parse(src) if err != nil { return nil, err } return &Query{query: query}, nil } func (q *Query) Run(input []byte) (*Iterator, error) { ... }
$ gomobile bind \ -target=ios,iossimulator,macos,maccatalyst \ -iosversion 14 \ -prefix
GOJQ \ -o Frameworks/GOJQBinding.xcframework \ github.com/cockscomb/swift-gojq/binding
import Foundation open class GOJQBindingIterator : NSObject, goSeqRefInterface { public
init() open func next() throws -> Data } open class GOJQBindingQuery : NSObject, goSeqRefInterface { public init?(_ src: String?) open func run(_ input: Data?) throws -> GOJQBindingIterator } public func GOJQBindingNewQuery(_ src: String?, _ error: NSErrorPointer) -> GOJQBindingQuery?
import GOJQBinding enum QueryError: Error { case unknown } public
struct Query { private let binding: GOJQBindingQuery public init(_ query: String) throws { var error: NSError? guard let binding = GOJQBindingNewQuery(query, &error) else { throw error ?? QueryError.unknown } self.binding = binding } public func run(_ input: Data) throws -> AsyncThrowingStream<Data, any Error> { ... } }
None
// swift-tools-version: 5.7 import PackageDescription let package = Package( name:
"SwiftGoJq", platforms: [ .macOS(.v13), .macCatalyst(.v14), .iOS(.v14) ], products: [ .library(name: “SwiftGoJq”, targets: ["SwiftGoJq"]), ], dependencies: [], targets: [ .binaryTarget( name: "GOJQBinding", url: "https://github.com/cockscomb/swift-gojq/releases/download/0.1.0/ GOJQBinding.xcframework.zip", checksum: "1c45710de17fb7020dcfc75105344729725c5e3875e7058e98790e5f4e178162"), .target( name: "SwiftGoJq", dependencies: [ "GOJQBinding", ]), ] )
cockscomb/swift-gojq
None
import AppIntents import AsyncAlgorithms import SwiftGoJq struct JQIntent: AppIntent {
static var title: LocalizedStringResource = "jq" @Parameter(title: "JSON") var input: String @Parameter(title: "Query") var query: String static var parameterSummary: some ParameterSummary { Summary("\(\.$input) | jq '\(\.$query)'") } func perform() async throws -> some IntentResult { let jq = try Query(query) let results = try jq.run(input) let array = try await Array(results) return .result(value: array) } }
None
None
WEB+DB PRESS vol. 1 3 2 iOS 1 6 12/24
3 id:cockscomb id:yutailang 01 19 id:kouki_dan