Skip to content

Instantly share code, notes, and snippets.

$ PATH=$(getconf PATH):~/.cargo/bin cargo install ...
@s1rius
s1rius / PrintTaskDetail.gradle
Last active August 16, 2023 06:57
Print task input and output files when execute
gradle.taskGraph.afterTask { task ->
StringBuffer taskDetail = new StringBuffer()
taskDetail << """---
name: $task.name group: $task.group $task.description
inputs:
"""
task.inputs.files.each { it ->
taskDetail << "${it.absolutePath} \n"
}
{"sig":"926649ec6e5ad17d819901e4caada65320674c21bc3e405bd43415cf7f30929ac4e03cad9d3a6c7c5af8bdc6bb4f54d159fa924cf630e48defb6445166028ede1","msghash":"a3e65d9b343375d427f994e017f134538d32b36258ad7048b074c06812d53635"}
package me.s1rius.multidrawee;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
/*
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package com.facebook.imagepipeline.producers;
1.download opencv 2.4.11 on ~/opencv-2.4.11
2.download cmake-3.5.1-Darwin-x86_64.dmg and install
3.clone https://github.com/MasteringOpenCV/code on ~/MasteringOpenCV
4.use cmake build opencv like https://www.youtube.com/watch?v=U49CVY8yOxw
5.cd MasteringOpenCV
6.mkdir build, cd build
7.export OpenCV_DIR="~/opencv-2.4.11/build"
8.cmake -D OpenCV_DIR=$OpenCV_DIR ../src
9.make install
10.done
import android.view.animation.Animation;
import android.view.animation.Transformation;
import android.widget.ProgressBar;
public class ProgressBarAnimation extends Animation {
private ProgressBar mProgressBar;
private int mTo;
private int mFrom;
private long mStepDuration;
@s1rius
s1rius / proguard.cfg
Created June 17, 2014 10:16
Proguard
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
package com.intel.driveapp;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import java.util.ArrayList;
@s1rius
s1rius / build.gradle
Created February 24, 2014 07:35
GreenDAO
// Just a dummy script building a useless jar file. Waiting for version 0.3 of Android's new build system.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7+'
}
}