Skip to content

Instantly share code, notes, and snippets.

View xujiaji's full-sized avatar
🍉
︿( ̄︶ ̄)︿

Xu Jiaji xujiaji

🍉
︿( ̄︶ ̄)︿
View GitHub Profile
@CaiJingLong
CaiJingLong / build_android.sh
Last active August 12, 2022 10:15
在mac上 使用ndk r21b 编译 ffmpeg 4.3.1 的so
#!/bin/bash
NDK=/Volumes/Samsung-T5/sdk/android-ndk-r21b
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/darwin-x86_64
API=21
function build_android() {
cd ffmpeg-4.3.1
echo "Compiling FFmpeg for $CPU"
./configure \
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active December 21, 2025 08:18
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
class Responder: NSObject {
@objc func segmentedControlValueChanged(_ sender: UISegmentedControl) {
UIView.animate(withDuration: 0.3) {
buttonBar.frame.origin.x = (segmentedControl.frame.width / CGFloat(segmentedControl.numberOfSegments)) * CGFloat(segmentedControl.selectedSegmentIndex)
}
@daniellevass
daniellevass / android_material_design_colours.xml
Last active September 22, 2025 03:36
Android Material Design Colours
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@arriolac
arriolac / TopCropImageView.java
Last active March 6, 2025 07:32
Custom Android ImageView for top-crop scaling of the contained drawable.
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by chris on 7/27/16.