Skip to content

Instantly share code, notes, and snippets.

@hanayashiki
hanayashiki / ios-screen-size.json
Last active January 20, 2023 16:35
A dictionary of different iPhone screen sizes (until iPhone 12)
{
"iPhone 6": {
"height": 667,
"width": 375
},
"iPhone 7": {
"height": 667,
"width": 375
},
"iPhone 8": {
@hanayashiki
hanayashiki / patch-arrayBuffer.js
Created December 16, 2019 04:08
Safari 13.0.4: Blob.arrayBuffer is not a function
(function () {
File.prototype.arrayBuffer = File.prototype.arrayBuffer || myArrayBuffer;
Blob.prototype.arrayBuffer = Blob.prototype.arrayBuffer || myArrayBuffer;
function myArrayBuffer() {
// this: File or Blob
return new Promise((resolve) => {
let fr = new FileReader();
fr.onload = () => {
resolve(fr.result);