This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'maven' | |
uploadArchives { | |
repositories { | |
mavenDeployer { | |
repository(url: "http://192.168.1.124:8081/repository/maven-releases/") { | |
authentication(userName: "admin", password: "admin123") | |
pom.groupId = "com.beesightsoft.caf" | |
pom.artifactId = "rx" | |
pom.version = '2.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
repositories { | |
jcenter() | |
maven { url "http://192.168.1.124:8081/repository/maven-releases/" } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home | |
export PATH=$JAVA_HOME/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nhancv.training; | |
import com.nhancv.training.main.MainPresenter; | |
import com.nhancv.training.main.MainView; | |
import com.nhancv.training.main.ObjectBus; | |
import org.greenrobot.eventbus.EventBus; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void genBitmapFile(Context context, View targetView, int num) { | |
int sizePixels = 1080; | |
Bitmap result = Bitmap.createBitmap(sizePixels, sizePixels, Bitmap.Config.ARGB_8888); | |
Canvas c = new Canvas(result); | |
// measure view first | |
int sizeSpec = View.MeasureSpec.makeMeasureSpec(sizePixels, View.MeasureSpec.EXACTLY); | |
targetView.measure(sizeSpec, sizeSpec); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static File saveBitmapToFile(Context context, String filename, Bitmap bitmap) { | |
File f = new File(context.getCacheDir(), filename); | |
Log.e(TAG, "saveBitmapToFile: " + f.getAbsolutePath()); | |
try { | |
f.createNewFile(); | |
//Convert bitmap to byte array | |
ByteArrayOutputStream bos = new ByteArrayOutputStream(); | |
bitmap.compress(Bitmap.CompressFormat.PNG, 0 /*ignored for PNG*/, bos); | |
byte[] bitmapdata = bos.toByteArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group 'com.beesightsoft.kotlin' | |
version '1.0-SNAPSHOT' | |
buildscript { | |
ext.kotlin_version = '1.1.60' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.JsonSlurper | |
def getNpmVersion() { | |
def inputFile = new File("../package.json") | |
def packageJson = new JsonSlurper().parseText(inputFile.text) | |
return packageJson["version"] | |
} | |
def getCommitTime() { | |
return (Integer) (Long.valueOf('git log -1 --pretty=format:%ct'.execute().getText().trim())/3600) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const app = express() | |
app.get('/', (req, res) => { | |
var connectionInterrupt = false; | |
var str = "a hihi do ngoc." + new Date().getTime() | |
console.log("Process: " + str); | |
req.connection.on('close',function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
//Time formatter input | |
String dataTime = "2018-01-18 11:59:59"; | |
String dateTimePattern = "yyyy-MM-dd HH:mm:ss"; | |
ZoneId zoneUTC = ZoneId.of("Z"); | |
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(dateTimePattern).withZone(zoneUTC); | |
//Get default zone and zone rules | |
ZoneId zoneCurrent = ZoneId.systemDefault(); | |
ZoneRules rules = zoneCurrent.getRules(); |
OlderNewer