Skip to content

Instantly share code, notes, and snippets.

@daemon369
daemon369 / build-copy-aar.gradle
Created April 21, 2022 06:27 — forked from ocus/build.gradle
Android Library Project - Copy AAR from build/outputs/aar/PROJECT-VARIANT.aar to build/PROJECT-VARIANT-VERSION_NAME.aar after each assembleVARIANT task
android.libraryVariants.all { variant ->
def variantName = variant.name.capitalize()
def copyTaskName = "copy${variantName}Artifacts"
def assembleTaskName = "assemble${variantName}"
task(copyTaskName, type: Copy, dependsOn: assembleTaskName, group: "build") {
variant.outputs.each { output ->
def newOutputName = output.outputFile.name.replace(".aar", "-" + android.defaultConfig.versionName + ".aar")
from(output.outputFile.parent) {
include output.outputFile.name
rename output.outputFile.name, newOutputName
@daemon369
daemon369 / For Mac 4.2.6 unlimited trial.md
Created February 10, 2022 15:33 — forked from rise-worlds/For Mac 4.2.6 unlimited trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher,4.2.5,4.2.6,4.3.7,it's works , this is the way which makes Always in evaluation mode 。

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+u BCompare : touch BCompare && chmod a+u BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
void main() {
print('test');
}
apply plugin: 'maven-publish'
afterEvaluate {
publishing {
publications {
bintray(MavenPublication) {
from components.release
groupId = pub.group
artifactId = pub.artifact
@daemon369
daemon369 / uploadArchives.gradle
Created March 18, 2019 15:03
upload archives to private repository
// read property from local.properties file
Properties local = new Properties()
local.load(project.rootProject.file('local.properties').newDataInputStream())
// publish to private repository
apply plugin: 'maven'
uploadArchives {
def username = local.getProperty("repo.username")
def password = local.getProperty("repo.password")
@daemon369
daemon369 / upload.gradle
Last active March 18, 2019 14:09
BintrayUpload
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
group = publishedGroupId
version = libraryVersion
install {
repositories.mavenInstaller {
pom.project {
packaging 'aar'
@daemon369
daemon369 / BetterRecyclerView.java
Created February 15, 2019 19:00 — forked from okmanideep/BetterRecyclerView.java
A RecyclerView that intercepts the scroll only if the user is scrolling in that direction
public class BetterRecyclerView extends RecyclerView{
private static final int INVALID_POINTER = -1;
private int mScrollPointerId = INVALID_POINTER;
private int mInitialTouchX, mInitialTouchY;
private int mTouchSlop;
public BetterRecyclerView(Context context) {
this(context, null);
}
public BetterRecyclerView(Context context, @Nullable AttributeSet attrs) {