Skip to content

Instantly share code, notes, and snippets.


DreamPiggy dreampiggy

View GitHub Profile
steipete / PSPDFGenerics.h
Last active Apr 28, 2020
Override copy and mutableCopy on Objective-C collection classes to pass along both the collection type and the generic info. This is a header-only "library". MIT licensed. Craving for more? foreach: even more: - ships in https://p…
View PSPDFGenerics.h
// PSPDFGenerics.h
// PSPDFFoundation
// PSPDFKit is the leading cross-platform solution for integrating PDFs into your apps:
// Try it today using our free PDF Viewer app:
// This file is MIT licensed.
rambolee /
Last active Jul 26, 2020
升级 小米路由器3 可以ssh 可以 Shadowsocks [Tags]: 小米路由, 小米路由3, 小米路由器, 小米路由器3, ssh, shadowsocks
#!/usr/bin/env python
# Generate a list of dnsmasq rules with ipset for gfwlist
# Copyright (C) 2014
# Ref
import urllib2
import re
steipete / SpinlockTestTests.swift
Last active Aug 10, 2020 — forked from RomanTruba/Synchronization_test_iOS_SDK10
Updated for Xcode 8, Swift 3; added os_unfair_lock
View SpinlockTestTests.swift
// SpinlockTestTests.swift
// SpinlockTestTests
// Created by Peter Steinberger on 04/10/2016.
// Copyright © 2016 PSPDFKit GmbH. All rights reserved.
import XCTest
View DisplayLink.swift
ericclemmons /
Last active Oct 8, 2020
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

 <summary>Summary Goes Here</summary>
steipete / gist:d9b44d8e9f341e81414e86d7ff8fb62d
Last active Oct 23, 2020
Using iOS 14 devices with Xcode 11.5 (instead of Xcode 12)
View gist:d9b44d8e9f341e81414e86d7ff8fb62d
// The trick is to link the DeviceSupport folder from the beta to the stable version.
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
// Support iOS 14 devices (Xcode 12.0) with Xcode 11.5:
sudo ln -s /Applications/ /Applications/
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
ralph089 / .wakeup
Last active Jan 14, 2020
Restarts Bluetooth Module on Mac OS X. You can use the script as shortcut to restart Bluetooth on demand or you can use it with "SleepWatcher" to automatically restart Bluetooth on wakeup (See I created it, because my Logitech Bluetooth Mouse doesn't stay connected after sleep-mode, so i had to manually re-pair my mouse.
View .wakeup
# Restart Bluetooth Module on Mac OS X
# Requires Blueutil to be installed:
log() {
echo "$@"
subfuzion /
Last active Oct 23, 2020
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

dreampiggy / gist:bfb42393395e57a1117e
Last active May 11, 2016 — forked from fabiofl/gist:5873100
Clear Mac OS X's icon cache.
View gist:bfb42393395e57a1117e
sudo find /private/var/folders/ \
-name -exec rm {} \;
sudo find /private/var/folders/ \
-name -exec rm -rf {} \;
sudo rm -rf /Library/Caches/
jtbandes / decode-dyn-uti.swift
Last active Oct 12, 2019
Dynamic UTI decoding
View decode-dyn-uti.swift
/// Decodes a dynamically-generated Uniform Type Identifier for inspection purposes. (**NOT FOR PRODUCTION USE!**)
/// Many, many thanks to
/// <>
func decodeDynUTI(_ uti: String) -> String?
let vec = Array("abcdefghkmnpqrstuvwxyz0123456789")
let encoded = Array(uti).suffix(from: 5)
var result: [UInt8] = []
You can’t perform that action at this time.