Skip to content

Instantly share code, notes, and snippets.

View trinnguyen's full-sized avatar

Tri Nguyen trinnguyen

View GitHub Profile
@trinnguyen
trinnguyen / config.yml
Last active October 19, 2018 14:58
CircleCI 2.0 Android config with Keystore Signing
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
@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
@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 / 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 / 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 / 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 / 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: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 / 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: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