Skip to content

Instantly share code, notes, and snippets.

View dotrinh-DM's full-sized avatar
🤝
leadership

Do Trinh dotrinh-DM

🤝
leadership
View GitHub Profile
@dotrinh-DM
dotrinh-DM / ZoomLayout.java
Created February 19, 2019 07:36 — forked from anorth/ZoomLayout.java
Pinch-zoomable Android frame layout
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;
@dotrinh-DM
dotrinh-DM / wordpress admin
Created June 17, 2021 06:54
when "Screen Option" does not work, use this snippet!
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;");
});
})
_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
_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
@dotrinh-DM
dotrinh-DM / Animation.md
Created July 21, 2021 05:36 — forked from JeOam/Animation.md
iOS Core Animation: Advanced Techniques, Part 1: The Layer Beneath

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:

@dotrinh-DM
dotrinh-DM / ThirdMenuVC.m
Created November 5, 2021 11:43
prevent cell text is too long iOS
//prevent cell.valueLabel.text is too long
if(self.screenWidthShare <= 320){
if (rightMarkString.length >= 6) {
rightMarkString = [NSString stringWithFormat:@"%@...", [rightMarkString substringToIndex:3]];
}
} else {
if (rightMarkString.length >= 17) {
rightMarkString = [NSString stringWithFormat:@"%@...", [rightMarkString substringToIndex:12]];
}
}
@dotrinh-DM
dotrinh-DM / laravellocal.md
Created May 25, 2022 13:08 — forked from hootlex/laravellocal.md
Run laravel project locally

##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
@dotrinh-DM
dotrinh-DM / IDE.txt
Last active July 22, 2022 12:13
Remove empty line in Jetbrains's IDE
Having to mix to get best result:
Replace: \n\n by \n
Replace: ^\s*^ by empty
@dotrinh-DM
dotrinh-DM / Tool.java
Created September 14, 2022 11:05
writing log to file
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);
}
@dotrinh-DM
dotrinh-DM / hello_world.asm
Created December 23, 2022 10:13
Hello World Assembly Program on macOS
; ----------------------------------------------------------------------------------------
; Writes "Hello, World" to the console using only system calls. Runs on 64-bit macOS only.
; macOS:
; nasm -f macho64 hello_world.asm
; ld -macosx_version_min 10.7.0 -o hello_world hello_world.o
; ./hello_world
; ----------------------------------------------------------------------------------------
global start