- Download the docset index XML.
- Find the docset you want (there are some with URL https://apple.com/none.dmg; ignore them - you will find them again further down the file with a working URL).
- Download the dmg. It's probably around a gigabyte or so.
- "Install" the .pkg file somewhere on your disk. If you don't trust the installer, do it manually:
- Find the largest file, named Payload, and extract it using The Unarchiver.
- This creates a new, even larger file, probably named Payload-1.
- Extract Payload-1 using The Unarchiver.
- After many minutes of extracting, we have our .docset file.
// https://twitter.com/_saagarjha/status/1692839886053625917#m | |
#import <Foundation/Foundation.h> | |
#import <atomic> | |
#import <memory> | |
#import <objc/runtime.h> | |
#include <objc/message.h> | |
#import <stdexcept> | |
#import <iostream> |
- MSR modification may void your CPU's (or system board's) warranty. Proceed with care. I'm not responsible for any destruction caused by this article.
- MSR address (greatly) differs from CPU to CPU. Check your own CPU's MSR address using Intel's documentation.
- Only tested on Intel i7-8550U (Kaby Lake R).
- This article is translation of this article. If you can understand Korean, I recommend reading that article, not this.
From https://docs.google.com/document/d/1Nsv52MvSjbLb2PCpHlat0gkzw0EvtSgpKHu4mk0MnrA/ | |
Save Page Now 2 Public API Docs Draft | |
Vangelis Banos, updated: 2022-04-05 | |
Capture a web page as it appears now for use as a trusted citation in the future. Changelog: https://docs.google.com/document/d/19RJsRncGUw2qHqGGg9lqYZYf7KKXMDL1Mro5o1Qw6QI/edit# | |
Contents | |
Glossary 1 | |
Basic API Reference 1 | |
Capture request 1 |
##Debouncing using GCD on iOS
The idea of "Debouncing" is to limit the rate a function or task can execute by waiting a certain amount of time before executing it. In the example below, if a user rapidly enters input, it will only execute once, 1 second after all that input. This is the implementation of a sample class showing how to do so, while using Grand Central Dispatch to create a timer. The timer fires on a global queue in this example - but you can change the queue to any queue where you want the timer to execute, regardless of where you set it up.
#import <Foundation/Foundation.h>
@interface DebounceExample : NSObject
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
-
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
-
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
(() => { | |
const isNotUndefined = typeofResult => typeofResult !== 'undefined'; | |
if(isNotUndefined(typeof globalThis) && globalThis.globalThis === globalThis) { return; } | |
const g = (isNotUndefined(typeof window) && window) | |
|| (isNotUndefined(typeof global) && global) | |
|| (isNotUndefined(typeof self) && self) | |
|| Function('return this')(); | |
g.globalThis = g; | |
})(); |
if(!String.prototype.matchAll) { | |
String.prototype.matchAll = function (rx) { | |
if (typeof rx === "string") rx = new RegExp(rx, "g"); // coerce a string to be a global regex | |
rx = new RegExp(rx); // Clone the regex so we don't update the last index on the regex they pass us | |
let cap = []; // the single capture | |
let all = []; // all the captures (return this) | |
while ((cap = rx.exec(this)) !== null) all.push(cap); // execute and add | |
return all; // profit! | |
}; | |
} |
<html> | |
<head> | |
<title>Test</title> | |
<script type="text/javascript"> | |
window.alert('Hello'); | |
</script> |