Skip to content

Instantly share code, notes, and snippets.

@4brunu
4brunu / fixup-old-macos-sdks.sh
Created November 6, 2021 23:33 — forked from natbro/fixup-old-macos-sdks.sh
script to link older macOS SDKs into newer Xcode so you can target older platforms properly
#!/bin/bash
# ---------------------------------------------------------------------------------------------------------
# place as many old macOS SDKs into the directory with this script e.g. if you have
#
# my-macpro:SDKs natb$ ls -ahl
# total 4254792
# drwxr-xr-x 17 natb admin 578B Nov 21 2017 .
# drwxrwxr-x 24 root admin 884B Aug 29 06:46 ..
# drwxr-xr-x 5 natb admin 170B Oct 17 2017 MacOSX10.10.sdk
@4brunu
4brunu / xcode-previous-older-sdks.md
Created November 6, 2021 23:33 — forked from kenji21/xcode-previous-older-sdks.md
Use previous/older SDKs with Xcode
@4brunu
4brunu / change-sdk.sh
Created November 6, 2021 23:30 — forked from bodja/change-sdk.sh
Download MacOSX SDK version and change minimum sdk version in info.plist
SDK_VERSION=$1
SDK_NAME="MacOSX${SDK_VERSION}.sdk"
TAR_FILE_NAME="${SDK_NAME}.tar.xz"
DOWNLOAD_URL="https://github.com/phracker/MacOSX-SDKs/releases/download/MacOSX10.11.sdk/${TAR_FILE_NAME}"
TAR_FILE_DEST="/tmp/${TAR_FILE_NAME}"
SDK_MIN_VERSION_FILE="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist"
SDK_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/"
echo Downloading $SDK_NAME
curl -L $DOWNLOAD_URL -o $TAR_FILE_DEST --progress-bar
@4brunu
4brunu / SampleViewController.swift
Created January 20, 2017 15:17 — forked from JaviSoto/SampleViewController.swift
Init based Storyboard View Controller Instantiation
final class SampleViewController: StoryboardBackedViewController {
// Unfortunately this must be an IUO var, so that we can set the value after super.init
private var member: Foo!
// Proper dependency injection in a storyboard backed VC!
init(foo: Foo) {
super.init(storyboardIdentifier: "SampleViewControllerIdentifier")
// We have to set the members *after* calling super.init, since it changes the instance of `self`.
self.member = foo
@4brunu
4brunu / README.md
Created June 21, 2016 12:15 — forked from lopspower/README.md
Material Animations

Material Animations

Android Arsenal

[Android Transition Framework][transition-framework] can be used for three main things:

  1. Animate activity layout content when transitioning from one activity to another.
  2. Animate shared elements (Hero views) in transitions between activities.
  3. Animate view changes within same activity.
@4brunu
4brunu / ExpiringLruCache.java
Created April 7, 2016 10:12 — forked from christopherperry/ExpiringLruCache.java
LruCache for Android with expiring keys. Instead of modifying LruCache directly I used delegation to get around final keyword usage and a dirty hack to override everything else.
import android.os.SystemClock;
import android.support.v4.util.LruCache;
import java.util.HashMap;
import java.util.Map;
/**
* An Lru Cache that allows entries to expire after
* a period of time. Items are evicted based on a combination
* of time, and usage. Adding items past the {@code maxSize}
@4brunu
4brunu / Remove Submodule
Created March 30, 2016 10:57 — forked from kyleturner/Remove Submodule
How to remove a submodule from a Github project
To remove a submodule you need to:
Delete the relevant line from the .gitmodules file.
Delete the relevant section from .git/config.
Run git rm --cached path_to_submodule (no trailing slash).
Commit and delete the now untracked submodule files.
@4brunu
4brunu / README.md
Created February 24, 2016 11:21 — forked from lopspower/README.md
Android Tools Attributes

Android Tools Attributes

Twitter

Android has a dedicated XML namespace intended for tools to be able to record information in XML files, and have that information stripped when the application is packaged such that there is no runtime or download size penalty. The namespace URI is http://schemas.android.com/tools and is usually bound to the tools: prefix:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
@4brunu
4brunu / SomeFragment.java
Created November 9, 2015 21:57 — forked from joshdholtz/SomeFragment.java
Android Google Maps V2 - MapView in XML
public class SomeFragment extends Fragment {
MapView mapView;
GoogleMap map;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.some_layout, container, false);