Skip to content

Instantly share code, notes, and snippets.

View timonus's full-sized avatar

Tim Johnsen timonus

View GitHub Profile
@saagarjha
saagarjha / MetadataExtractor.js
Created February 17, 2023 09:36
Apple's metadata extraction code for link previews in Messages, taken from macOS Ventura 13.3 Beta (22E5219e)
//
// LinkPresentation
// Copyright © 2015-2020 Apple Inc. All rights reserved.
//
// FIXME: Twitter equivalents?
(function () {
var MetadataExtractor = {
@kylehowells
kylehowells / FreeSpaceViewController.swift
Created May 4, 2022 23:24
UIViewController subclass to show both the Settings app displayed free space, and the real free space.
//
// FreeSpaceViewController.swift
// Free Space
//
// Created by Kyle Howells on 04/05/2022.
//
import UIKit
class FreeSpaceViewController: UIViewController {
@saagarjha
saagarjha / swizzler.h
Last active December 25, 2023 18:06
Type-safe, RAII swizzler for Objective-C++
// Example usage:
// Swizzler<NSString *, NSDateFormatter *, NSDate *> NSDateFormatter_stringFromDate_ {
// NSDateFormatter.class, @selector(stringFromDate:), [&](auto self, auto date) {
// if ([NSCalendar.currentCalendar components:NSCalendarUnitWeekday fromDate:date].weekday == 4) {
// return @"It Is Wednesday My Dudes";
// } else {
// return NSDateFormatter_stringFromDate_(self, date);
// }
// }
// };
sudo cp -r /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.0\ \(16A5318d\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 26, 2024 16:33 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@kentbrew
kentbrew / pinterest_meta.md
Created June 5, 2017 22:12
Pinterest's META Namespace

Just like Facebook and Twitter, Pinterest has its own namespace. Go like this:

<meta property="pin:url" content="https://yourpage.com/pinit/test/pinterest_meta.html" />
<meta property="pin:description" content="This pin was generated by the Pinterest meta." />
<meta property="pin:media" content="http://cdn.yourpage.com/your_image_here.jpg" />

... and your preferred image (which need not actually appear on the page) will show at the top of the grid when someone uses Pinterest's mobile device, browser extension, or Any Image Save button.

@steipete
steipete / SpinlockTestTests.swift
Last active August 29, 2023 08:47 — forked from RomanTruba/Synchronization_test_iOS_SDK10
Updated for Xcode 8, Swift 3; added os_unfair_lock
//
// SpinlockTestTests.swift
// SpinlockTestTests
//
// Created by Peter Steinberger on 04/10/2016.
// Copyright © 2016 PSPDFKit GmbH. All rights reserved.
//
import XCTest
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@0xced
0xced / Emoji-iOS-10.0-14A5322e.json
Created August 8, 2016 22:38
Emoji from iOS beta 4 (14A5322e)
{
"People" : [
{
"Symbol" : "😀",
"Name" : "GRINNING FACE"
},
{
"Symbol" : "😬",
"Name" : "GRIMACING FACE"
},
@mackuba
mackuba / wwdc16.md
Last active March 5, 2023 21:28
New stuff from WWDC 2016

Following the tradition from last year, here's my complete list of all interesting features and updates I could find in Apple's OSes, SDKs and developer tools that were announced at this year's WWDC. This is based on the keynotes, the "What's New In ..." presentations and some others, Apple's release notes, and blog posts and tweets that I came across in the last few weeks.

If for some reason you haven't watched the talks yet, I really recommend watching at least the "State of the Union" and the "What's New In" intros for the platforms you're interested in. The unofficial WWDC Mac app is great way to download the videos and keep track of what you've already watched.

If you're interested, here are my WWDC 2015 notes (might be useful if you're planning to drop support for iOS 8 now and start using some iOS 9 APIs).


OSX → macOS 10.12 Sierra