Skip to content

Instantly share code, notes, and snippets.

View Clafou's full-sized avatar

Seb Molines Clafou

View GitHub Profile
@mrmnmly
mrmnmly / gist:2556fe35b98f7e863ddb7149128eb792
Created July 2, 2017 10:58
CUPS Printer print borderless
Use:
```
lpoptions -l printername
```
to view the list of printer options. The two lines of interest are:
`StpiShrinkOutput/Shrink` Page If Necessary to Fit Borders: Shrink Crop *Expand
`StpBorderless/Borderless`: False *True
@steipete
steipete / UIKitLegacyDetector.m
Last active May 21, 2025 10:07
A simple way to detect at runtime if we're running in UIKit legacy mode or the new "flat" variant. Written for our PDF iOS SDK (http://pspdfkit.com), where the precompiled binary needs to detect at runtime in what variant it's running. Want more stuff like that? Follow me on Twitter: http://twitter.com/steipete
// Taken from http://PSPDFKit.com. This snippet is under public domain.
#define UIKitVersionNumber_iOS_7_0 0xB57
BOOL PSPDFIsUIKitFlatMode(void) {
static BOOL isUIKitFlatMode = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7.
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0;
}
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active May 9, 2026 20:21
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@tomster
tomster / git-dropbox
Created January 1, 2011 15:40
Create a symlink of the current .git inside your Dropbox, now all your local commits will automatically be backed up to Dropbox (without your dropbox being littered with development cruft, like temporary build files)
#!/usr/bin/env python
# encoding: utf-8
""" Create a symlink of the current .git inside your Dropbox, now all your
local commits will automatically be backed up to Dropbox (without your dropbox
being littered with development cruft, like temporary build files)
"""
from os import getcwd, path, mkdir, symlink, chdir