Skip to content

Instantly share code, notes, and snippets.

View truongngoclinh's full-sized avatar
🎯
Focusing

Trương Ngọc Linh truongngoclinh

🎯
Focusing
  • Tokyo
View GitHub Profile
@truongngoclinh
truongngoclinh / gist:3b99f0cc89ed8005701e2fbf3c5093c2
Created June 22, 2017 08:00 — forked from steipete/ios-xcode-device-support.sh
Using iOS 10.3 devices with Xcode 8.2.1
// The trick is to link the DeviceSupport folder from the beta to the stable version.
// Updated on Jan 24th, 2017 for Xcode 8.3b1
ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.3\ \(14E5230d\)/ /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
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
@truongngoclinh
truongngoclinh / SpanStringBuilderSample.java
Created June 15, 2017 09:28
SpanStringBuilder android
SpannableStringBuilder builder = new SpannableStringBuilder(printerName);
StyleSpan boldSpan = new StyleSpan(Typeface.BOLD);
builder.setSpan(boldSpan, printerName.indexOf(printerCode), printerName.indexOf(printerCode) + printerCode.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
@truongngoclinh
truongngoclinh / KotlinVsSwift3
Last active June 12, 2017 09:05
KotlinVsSwift3
<p align="center">
<img alt="Kotlin" src="http://antonioleiva.com/wp-content/uploads/2015/03/kotlin.png">
</p>
<p align="center">
<img alt="Swift" src="https://cdn1.macworld.co.uk/cmsdata/features/3523633/swift_3_thumb800.jpg">
</p>
# Kotlin vs Swift 3
@truongngoclinh
truongngoclinh / gist:368aa2ddfbc1557b24da4a44a5dd376f
Created June 12, 2017 08:21 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@truongngoclinh
truongngoclinh / HTTPService.h
Created June 9, 2017 04:43
Sample to create own server working with iOS app on rest api
//
// HTTPService.h
// Tutorials
//
// Created by Linh on 6/7/17.
// Copyright © 2017 Linh. All rights reserved.
//
#import <Foundation/Foundation.h>
@truongngoclinh
truongngoclinh / VideoVC.m
Created June 9, 2017 04:01
iOS 100%width youtube vide embed
- (void)viewDidLoad {
[super viewDidLoad];
self.mWebView.delegate = self;
[self.mWebView loadHTMLString:self.video.videoIframe baseURL:nil];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSString *css = @".container {position: relative; width: 100%; height: 0; padding-bottom: 56.25%;}.video {position: absolute; top: 0; left: 0; width: 100%; height: 100%;} ";
NSString* js = [NSString stringWithFormat:
@truongngoclinh
truongngoclinh / HTMLFormatWebView.html
Last active June 8, 2017 11:25
Sample HTML format for android webview after converting from word file
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<style type="text/css">@import url('https://themes.googleusercontent.com/fonts/css?kit=dpiI8CyVsrzWsJLBFKehGpLhv3qFjX7dUn1mYxfCXhI');ol{margin:0;padding:0}table td,table th{padding:0}.c2{color:#3f3f3f;font-weight:700;text-decoration:none;vertical-align:baseline;font-size:10.5pt;font-family:"Roboto";font-style:normal}.c1{color:#3f3f3f;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:10.5pt;font-family:"Roboto";font-style:normal}.c9{color:#c43036;font-weight:700;text-decoration:none;vertical-align:baseline;font-size:24pt;font-family:"Roboto";font-style:normal}.c5{color:#000000;font-weight:400;text-decoration:none;vertical-align:baseline;font-size:11pt;font-family:"Arial";font-style:normal}.c0{padding-top:11pt;padding-bottom:11pt;line-height:1.5;orphans:2;widows:2;text-align:justify}.c8{padding-top:11pt;padding-bottom:11pt;line-height:1.5;orphans:2;widows:2;text-align:left}.c7{font-size
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@truongngoclinh
truongngoclinh / Android Privacy Policy Template
Created June 8, 2017 10:54 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@truongngoclinh
truongngoclinh / Filter32.java
Created May 5, 2017 09:15
React native issue with loading 64 bit .so libs
// https://corbt.com/posts/2015/09/18/mixing-32-and-64bit-dependencies-in-android.html
android {
...
defaultConfig {
...
ndk {
abiFilters "armeabi-v7a", "x86"
}