Skip to content

Instantly share code, notes, and snippets.

@kconner
kconner / macOS Internals.md
Last active November 13, 2024 07:51
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

Google has an amazing free API endpoint for text completions ,

below are some examples of the completions I got and the python code to interact with the API

Star this gist if this was helpful to you. Enjoy text completions

user@linux:$ python3 google_text_completion.py
 > hackers are
hackers are watching you
@thomsmed
thomsmed / throttle.swift
Created November 7, 2021 14:51
Basic throttle function in Swift
//
// trottle.swift
//
import Foundation
func throttle(interval: TimeInterval, queue: DispatchQueue = .main, action: @escaping (() -> Void)) -> () -> Void {
var lastFire: TimeInterval = 0
return {
@cielavenir
cielavenir / readme.md
Last active October 23, 2024 12:42
zoom sandbox-exec for macOS
  1. Download Zoom.pkg from https://zoom.us/download
  2. Extract it using https://www.timdoug.com/unpkg/
  3. Now you have Zoom/zoom.us.app
  4. Launch Zoom by zoom.sh Zoom/zoom.us.app/Contents/MacOS/zoom.us

caveats:

  • Zoom will fail to start meeting for the first time. Just launch again.
  • Zoom will tell that crash happened, but you should ignore it.
@brennanMKE
brennanMKE / Playground.swift
Created April 26, 2021 19:45
Cross Platform Property Wrapper
import Foundation
#if canImport(UIKit)
import UIKit
#elseif canImport(AppKit)
import AppKit
#elseif canImport(WatchKit)
import WatchKit
#endif
@tranquan
tranquan / xcode-keybindings-as-vscode.md
Last active November 5, 2024 00:58
Xcode KeyBindings as VSCode
@AFutureD
AFutureD / Hypothesis.user.js
Last active July 23, 2024 13:54
A Tempermonkey script for Hypothes.is
// ==UserScript==
// @name Hypothesis
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author AFuture
// @match *://*/*
// @grant none
// ==/UserScript==
@ih2502mk
ih2502mk / list.md
Last active November 18, 2024 08:01
Quantopian Lectures Saved
@IanColdwater
IanColdwater / twittermute.txt
Last active November 17, 2024 02:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
CREATE OR REPLACE FUNCTION generate_sequential_uuid(p_interval_length int DEFAULT 60)
RETURNS uuid
LANGUAGE plpgsql
AS $$
DECLARE
v_i int;
v_time bigint;
v_bytes int[16] = '{}';
v_hex text[16] = '{}';
BEGIN