Skip to content

Instantly share code, notes, and snippets.

View fromkk's full-sized avatar

Kazuya Ueoka fromkk

View GitHub Profile
@bannzai
bannzai / add_sendable.sh
Last active June 16, 2024 02:42
struct, enumに脳死でSendableをつけるsed。Viewは除外
#!/bin/bash
TARGET_DIR=$1
echo "やるお"
for file in $(find "$TARGET_DIR" -name "*.swift"); do
# struct User: * { の場合。ただし、View適応は除く
sed -i '' -E '/struct [A-Za-z0-9_]+: [^{]*View[^{]*\{/!s/(struct [A-Za-z0-9_]+: [^{]*)\{/\1, Sendable {/g' "$file"
sed -i '' -E '/enum [A-Za-z0-9_]+: [^{]*View[^{]*\{/!s/(enum [A-Za-z0-9_]+: [^{]*)\{/\1, Sendable {/g' "$file"
@laprasdrum
laprasdrum / sendDirectMessage.gs
Created April 29, 2021 01:51
send direct messages (including group DMs) from GAS
const token = 'xoxb-xxx'
function main() {
var message = 'Hi :)'
// send direct message
var userID = 'UX...'
sendMessage(userID, message)
// send group direct message
@d-date
d-date / project.yml
Last active March 17, 2024 21:17
XcodeGen Example
name: XXXX
attributes:
LastUpgradeCheck: 1140
ORGANIZATIONNAME: "kankak, Inc."
options:
bundleIdPrefix: com.xxxx.xxxxxxxx
deploymentTarget:
iOS: 13.1.3
configs:
Develop Debug: debug
extension Optional {
public mutating func ensure(_ f: () throws -> Wrapped) rethrows -> Wrapped {
if let x = self {
return x
}
let x = try f()
self = x
return x
}
@tikidunpon
tikidunpon / timers_wwdc20190618.md
Last active June 19, 2019 01:01
Timers Meetup #2 ~WWDC After Party~の参加メモ
@takoikatakotako
takoikatakotako / ViewController.swift
Created March 5, 2018 01:51
QRコードを生成するサンプル
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//文字列をNSDataに変換し、QRコードを作成します。
//Converts a string to NSData.
let str = "カビゴン可愛い、大好き"