Skip to content

Instantly share code, notes, and snippets.

View trinnguyen's full-sized avatar

Tri Nguyen trinnguyen

View GitHub Profile
@trinnguyen
trinnguyen / gist:2fcb4a2ff619c800fc916a83f4e72ccb
Created September 24, 2016 07:52
ios launch-screen image size
https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/
Static Launch Screen Images
It’s best to use an Xcode storyboard for your launch screen, but you can provide a set of static images if necessary. Create static images in different sizes for different devices, and be sure to include the status bar region.
Device Portrait size Landscape size
iPhone 6s Plus, iPhone 6 Plus 1080px by 1920px 1920px by 1080px
iPhone 6s, iPhone 6 750px by 1334px 1334px by 750px
iPhone SE 640px by 1136px 1136px by 640px
@trinnguyen
trinnguyen / gist:26100c9dbb5f818982ff1eac4e1e84b4
Created September 25, 2016 15:43
Terminal fresh installation for macOS on USB
sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction
@trinnguyen
trinnguyen / xamios-push.cs
Last active October 10, 2016 04:21
Xamarin.iOS Register Push Notification with SDK 10
if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
{
var center = UNUserNotificationCenter.Current;
center.RequestAuthorization(UNAuthorizationOptions.Sound | UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge, (bool arg1, NSError error) =>
{
InvokeOnMainThread(() =>
{
if (error == null)
{
UIApplication.SharedApplication.RegisterForRemoteNotifications();
@trinnguyen
trinnguyen / gist:2dd97d077755b1a943eff1def8189648
Created October 15, 2016 06:10
OS X Terminal - Enabled exFAT on DiskUltility
defaults write com.apple.DiskUtility advanced-image-options 1
@trinnguyen
trinnguyen / gist:3349817635107df23f5a60deb1595821
Created November 9, 2016 08:11
Xamarin.iOS Debug over Wifi
<IOSDebuggerHosts>10.1.1.222</IOSDebuggerHosts>
<IOSDebuggerConnectOverUsb>False</IOSDebuggerConnectOverUsb>
<IOSDebugOverWiFi>true</IOSDebugOverWiFi>
<IOSDebuggerPort>10001</IOSDebuggerPort>
@trinnguyen
trinnguyen / gist:8454671a455bdb9c00205e47f79564e2
Created December 10, 2016 14:11
Objective Sharpie - bind KYDrawerController.framework (Swift)
sharpie bind -scope KYDrawerController.framework/Headers KYDrawerController.framework/Headers/KYDrawerController-Swift.h -sdk iphoneos10.1
@trinnguyen
trinnguyen / android_theme_runtime.java
Last active December 18, 2016 08:20
Android refresh Activity when changing Theme at runtime
private void applyTheme() {
//Option 1: //Recreate screen
// recreate();
//Option 2: Start and Finish with Animation
startActivity(new Intent(this, this.getClass()));
finish();
// overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
overridePendingTransition(0, 0);
@trinnguyen
trinnguyen / AndroidClientHandlerLinkerOverride.cs
Created January 26, 2017 04:24
Workaround to fix Xamarin.Android Linker for AndroidClientHandler
using System;
namespace MyApp.Droid
{
public class AndroidClientHandlerLinkerOverride
{
public void Include()
{
var handler = new Xamarin.Android.Net.AndroidClientHandler();
}
}
@trinnguyen
trinnguyen / FaceDetector.h
Created February 7, 2017 09:00
Header file FaceDetector.h - Demo for OpenCV on Xamarin.iOS
@interface FaceDetector : NSObject
- (id) initWithFaceCascade:(NSString*) filePath;
- (NSArray*) detectFaces:(UIImage*) image;
@end
@trinnguyen
trinnguyen / VerticalTextView.cs
Created April 19, 2017 13:24
Vertical TextView for Xamarin.Android
using System;
using Android.Content;
using Android.Runtime;
using Android.Util;
using Android.Views;
namespace TNUtils.Droid
{
[Register("tnutils.droid.VerticalTextView")]
public class VerticalTextView : Android.Support.V7.Widget.AppCompatTextView