Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing Mode

Do Trinh dotrinhdev

🎯
Focusing Mode
View GitHub Profile
@dotrinhdev
dotrinhdev / Tool.java
Created Sep 14, 2022
writing log to file
View Tool.java
public static void log_to_internal_file(String data, Context context) {
try {
// /data/data/jp.co.xxx.G3ProRemote/files
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(context.openFileOutput("debug_log.txt", Context.MODE_APPEND));
String timeStamp = new SimpleDateFormat("yyyy:MM:dd_HH:mm:ss").format(Calendar.getInstance().getTime());
outputStreamWriter.append(timeStamp + " " + data + "\n");
outputStreamWriter.close();
} catch (IOException e) {
Log.e("Exception", "File write failed: " + e);
}
@dotrinhdev
dotrinhdev / IDE.txt
Last active Jul 22, 2022
Remove empty line in Jetbrains's IDE
View IDE.txt
Having to mix to get best result:
Replace: \n\n by \n
Replace: ^\s*^ by empty
@dotrinhdev
dotrinhdev / laravellocal.md
Created May 25, 2022 — forked from hootlex/laravellocal.md
Run laravel project locally
View laravellocal.md

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
@dotrinhdev
dotrinhdev / Animation.md
Created Jul 21, 2021 — forked from JeOam/Animation.md
iOS Core Animation: Advanced Techniques, Part 1: The Layer Beneath
View Animation.md

Author: https://www.cyanhall.com/

1. The Layer Tree

Core Animation's original name is Layer Kit

Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.

In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer. The only major feature of UIView that isn’t handled by CALayer is user interaction.

There are four hierarchies, each performing a different role:

View iOS 14.5 Framework List
_AuthenticationServices_SwiftUI.framework
_AVKit_SwiftUI.framework
_HomeKit_SwiftUI.framework
_MapKit_SwiftUI.framework
_QuickLook_SwiftUI.framework
_SceneKit_SwiftUI.framework
_SpriteKit_SwiftUI.framework
_StoreKit_SwiftUI.framework
Accelerate.framework
Accessibility.framework
View macOS Framework List
_AuthenticationServices_SwiftUI.framework
_AVKit_SwiftUI.framework
_MapKit_SwiftUI.framework
_QuickLook_SwiftUI.framework
_SceneKit_SwiftUI.framework
_SpriteKit_SwiftUI.framework
_StoreKit_SwiftUI.framework
Accelerate.framework
Accessibility.framework
Accounts.framework
@dotrinhdev
dotrinhdev / wordpress admin
Created Jun 17, 2021
when "Screen Option" does not work, use this snippet!
View wordpress admin
jQuery(document).ready(function ($) {
$("#contextual-help-link").click(function () {
$("#contextual-help-wrap").css("cssText", "display: block !important;");
});
$("#show-settings-link").click(function () {
$("#screen-options-wrap").css("cssText", "display: block !important;");
});
})
@dotrinhdev
dotrinhdev / ZoomLayout.java
Created Feb 19, 2019 — forked from anorth/ZoomLayout.java
Pinch-zoomable Android frame layout
View ZoomLayout.java
package au.id.alexn;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.widget.FrameLayout;