Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

View tinder-tannerbennett's full-sized avatar

Tanner Bennett tinder-tannerbennett

View GitHub Profile
@tinder-tannerbennett
tinder-tannerbennett /pull-req-files.js
Last activeMay 10, 2025 20:51
Tampermonkey userscripts for github.com that I use for work
// ==UserScript==
//@name pull/:id/files helpers (Approve PR)
//@namespace http://tampermonkey.net/
//@version 1.0
//@description Automatically clicks the "Review Changes" and "Approve" buttons on key press (\)
//@author Tanner Bennett
//@match https://github.com/TinderApp/tinder_ios/pull/*/files
//@icon https://www.google.com/s2/favicons?sz=64&domain=github.com
//@grant none
// ==/UserScript==
@tinder-tannerbennett
tinder-tannerbennett /MemoryFootprint.swift
CreatedSeptember 17, 2021 21:22
Get the memory footprint of the current process. Taken from StackOverflow.
func memoryFootprint()->mach_vm_size_t?{
letinteger_t_size= MemoryLayout<integer_t>.size
letcount=mach_msg_type_number_t(MemoryLayout<task_vm_info_data_t>.size/ integer_t_size)
letTASK_VM_INFO_REV1_COUNT=mach_msg_type_number_t(MemoryLayout.offset(of: \task_vm_info_data_t.min_address)!/ integer_t_size)
varinfo=task_vm_info_data_t()
let kr=withUnsafeMutablePointer(to:&info){ infoPtr in
infoPtr.withMemoryRebound(to: integer_t.self, capacity:Int(count)){ intPtrin
returntask_info(mach_task_self_,task_flavor_t(TASK_VM_INFO), intPtr,&count)
}

[8]ページ先頭

©2009-2025 Movatter.jp