Skip to content

Instantly share code, notes, and snippets.

View radutzan's full-sized avatar

Radu Dutzan radutzan

View GitHub Profile
@stefanceriu
stefanceriu / UINSSceneView+CTX.h
Last active January 17, 2022 15:10
Disable Mac Catalyst 77% app scaling
//
// UINSSceneView+CTX.h
// EFClass
//
// Created by Stefan Ceriu on 28/11/2019.
// Copyright © 2019 EF Education First. All rights reserved.
//
#import <Foundation/Foundation.h>
@steventroughtonsmith
steventroughtonsmith / gist:6763213
Created September 30, 2013 12:39
Non-opaque application windows in iOS 7, with optional blur. Shows the user's wallpaper under the app, with Parallax if supported.
typedef enum _UIBackgroundStyle {
UIBackgroundStyleDefault,
UIBackgroundStyleTransparent,
UIBackgroundStyleLightBlur,
UIBackgroundStyleDarkBlur,
UIBackgroundStyleDarkTranslucent
} UIBackgroundStyle;
@interface UIApplication (UIBackgroundStyle)
-(void)_setBackgroundStyle:(UIBackgroundStyle)style;
@toco
toco / TOCMotionEffectsEngine.m
Created September 27, 2013 11:14
Enable UIMotionEffects when AirPlay mirroring is turned on.
// Copyright (c) 2013 Tobias Conradi
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@dtorres
dtorres / Retina goodie.js
Created October 7, 2012 16:30
This gist allows you to serve proper images according to the resolution of the window.
/* Server side check if there is a cookie that defines
devicePixelRatio, if not, serve this javascript */
//Does it support it? no, default to 1;
if (window.devicePixelRatio === undefined) {
window.devicePixelRatio = 1;
}
//Setup cookie date.
var now = new Date();