Skip to content

Instantly share code, notes, and snippets.

@KamikX
KamikX / chrome-device-dimensions.md
Last active November 10, 2024 19:28 — forked from mfehrenbach/chrome-device-dimensions.md
Modern device dimensions for Chrome DevTools.

Modern Device Dimensions for Chrome DevTools

These are modern “Emulated Devices” (a.k.a. responsive dimensions) for Chrome DevTools’ Mobile Device Viewport Mode.

They are specifically Apple devices, subtracting for recent Safari UI (as in window.innerWidth/Height), and cleverly sorted with some dark-arts unicode shenanigans. (This glitchy, unloved portion of the tools sorts lexicographically, because of course it would.) Ergonomics!

before-after

Nest Hub Max? Come on. I dropped a bunch of devices that were older and/or close to these dimensions. It obviously doesn’t cover everything (sorry Android/Chrome), but offers a decent spread/increments for common 2023/2024 viewports.

@KamikX
KamikX / swagit.php
Created April 10, 2024 12:13 — forked from ls-dac-chartrand/swagit.php
Swag It: Reverse engineer Swagger-PHP annotations from an existing JSON payload
<?php
// -------------------------------------------------------------------------------------
// Add your JSON in the $input to generate Swagger-PHP annotation
// Inspired by: https://github.com/Roger13/SwagDefGen
// HOWTO:
// php -S localhost:8888 -t .
// http://localhost:8888/swagit.php
// -------------------------------------------------------------------------------------
@KamikX
KamikX / BleExtension.ks
Created February 4, 2021 10:00
Android check BLEv5 support
import android.bluetooth.BluetoothAdapter
import android.os.Build
import androidx.annotation.RequiresApi
@RequiresApi(Build.VERSION_CODES.O)
fun BluetoothAdapter.hasBleV5Support(): Boolean {
if (isLe2MPhySupported
|| isLeCodedPhySupported
|| isLeExtendedAdvertisingSupported
|| isLePeriodicAdvertisingSupported