Skip to content

Instantly share code, notes, and snippets.

@SpacyRicochet
SpacyRicochet / Playgrounds.swift
Created January 29, 2017 19:17
Snippet of the Week; Prototyping views in Playgrounds
import UIKit
import PlaygroundSupport
//: NSLayoutConstraint convenience methods
public extension NSLayoutConstraint {
public static func pinning(attribute: NSLayoutAttribute, ofView firstView: UIView, toView secondView: UIView, multiplier: CGFloat = 1, offset: CGFloat = 0) -> NSLayoutConstraint {
return NSLayoutConstraint(item: firstView, attribute: attribute, relatedBy: .equal, toItem: secondView, attribute: attribute, multiplier: multiplier, constant: offset)
}
@steipete
steipete / workaround.m
Created January 6, 2015 22:14
If you're implementing child view controllers and want automaticallyAdjustsScrollViewInsets to work...
// This ensures that the automaticallyAdjustsScrollViewInsets magic works
// On our newly added view controller as well.
// This triggers _layoutViewController which then triggers
// _computeAndApplyScrollContentInsetDeltaForViewController:
// which finally updates our content inset of the scroll view (if any)
// rdar://19053416
[self.navigationController.view setNeedsLayout];
@pedrommcarrasco
pedrommcarrasco / how-to-have-multiple-icons
Last active July 22, 2020 11:42
How To Have Multiple Icons (iPad)
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>default</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
@brianlow
brianlow / FindConflictingReferences.cs
Created January 3, 2012 03:04
Find conflicting assembly references
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
namespace MyProject
{
[TestFixture]
@novemberfiveco-gists
novemberfiveco-gists / WKCookieWebView.swift
Last active June 26, 2023 10:02
A WKWebView subclass that passes cookies after a 302 redirect response.
//
// WKCookieWebView.swift
//
// Created by Jens Reynders on 30/03/2018.
// Copyright (c) 2018 November Five
//
// 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
@bignerdranch
bignerdranch / BNRTimeBlock.h
Created March 9, 2012 13:51
Timing Utility Post 20120308
CGFloat BNRTimeBlock (void (^block)(void));
@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# 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 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@fs0c131y
fs0c131y / get_sqlcipher_password.js
Created January 27, 2019 20:57
Frida script to get the password of a sqlcipher database
/*
* get_sqlcipher_password.js
* Copyright (c) 2019 Elliot Alderson <fs0c131y@protonmail.com>
*
* Frida.re JS functions to get SQLCipher database passwords.
*
* Example usage:
* # frida -U -f in.gov.uidai.mAadhaarPlus -l get_sqlcipher_password.js --no-pause
*
*/
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@natelandau
natelandau / .bash_profile
Last active April 30, 2024 18:07
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management