Skip to content

Instantly share code, notes, and snippets.

View derrh's full-sized avatar

Derrick Hathaway derrh

View GitHub Profile
@mrousavy
mrousavy / react-native-screens+2.7.0.patch
Created May 12, 2020 14:53
react-native-screens Native Stack Navigator Android Translucent StatusBar inset patch
diff --git a/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java b/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java
index a9779ad..36726d6 100644
--- a/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java
+++ b/node_modules/react-native-screens/android/src/main/java/com/swmansion/rnscreens/ScreenStackHeaderConfig.java
@@ -3,6 +3,7 @@ package com.swmansion.rnscreens;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
+import android.os.Build;
import android.text.TextUtils;

To start using Carthage with a new project:

  1. List your dependencies in a Cartfile. Refer to the Carthage documentation for details.
  2. Run carthage bootstrap --no-build --use-submodules
  3. Create a new workspace.
  4. Drag your existing App project into the workspace.
  5. Drag framework dependency projects from ./Carthage/Checkouts into the workspace.
  6. Go to the General tab of your target properties.
  7. Add framework dependencies to Linked Frameworks and Libraries. They will show up as Workspace frameworks.
  8. Add the same frameworks to Embedded Binaries.
  9. Note, the previous step will probably create duplicates in Linked Frameworks and Libraries. Delete the duplicates.
@boopathi
boopathi / README.md
Last active August 28, 2023 14:35
Creating a Swift-ReactNative project

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,
@andymatuschak
andymatuschak / MultiDirectionAdjudicatingScrollView.swift
Created January 26, 2015 19:31
Source for the Khan Academy app's unusual scrolling interactions
//
// MultiDirectionAdjudicatingScrollView.swift
// Khan Academy
//
// Created by Andy Matuschak on 12/16/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
import UIKit.UIGestureRecognizerSubclass
@orta
orta / gist:7117853
Created October 23, 2013 12:36
HTML -> NSAttributedString using only UIKit
+ (NSAttributedString *)artsyBodyTextAttributedStringFromHTML:(NSString *)HTML withFont:(UIFont *)font
{
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
style.lineHeightMultiple = 1.2;
style.paragraphSpacing = font.pointSize * .5;
NSDictionary *textParams = @{
NSFontAttributeName : font,
NSParagraphStyleAttributeName : style,
@jarsen
jarsen / NSArrayMagic.m
Last active July 24, 2018 09:22
How to do lots of cool things with NSArray. Inspired by NSHipster and WWDC 2013 Session 228 - "Hidden Gems in Cocoa and Cocoa Touch"
NSArray *albums = @[[Album albumWithName:@"Random Access Memories" price:9.99f],
[Album albumWithName:@"Clarity" price:6.99f],
[Album albumWithName:@"Weekend in America" price:7.99f],
[Album albumWithName:@"Weekend in America" price:7.90f],
[Album albumWithName:@"Bangarang EP" price:2.99f]];
// Reversing an Array
__unused NSArray *reversed = albums.reverseObjectEnumerator.allObjects;
// PREDICATES