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 java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import org.apache.http.HttpEntity; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.ClientProtocolException; | |
import org.apache.http.client.HttpClient; | |
import org.apache.http.client.methods.HttpGet; |
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
PackageInfo info = getPackageManager().getPackageInfo("<your_package_name>", PackageManager.GET_SIGNATURES); | |
for (Signature signature : info.signatures) { | |
MessageDigest md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
Log.d("Hash Key:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); | |
} |
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
router.get('/api/birthday', function (req, res, next) { | |
var month = moment().month() + 1; | |
var today = moment().date(); | |
var tomorrow = moment().add(1, 'days').date(); | |
Costumer.findAll({ | |
attributes: ['id','name','birthDate'], | |
where: { | |
$and: [ | |
sequelize.where(sequelize.fn('month', sequelize.col("birth_date")), month) | |
], |
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 android.text.TextUtils; | |
import java.io.IOException; | |
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Type; | |
import java.net.SocketTimeoutException; | |
import javax.net.ssl.HttpsURLConnection; | |
import br.com.experience.hsm.data.entity.ErrorEntity; |
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 br.com.celg.pd318 | |
class StudsUtil { | |
static enum SeqPosition { | |
START, | |
MIDDLE, | |
END | |
} |
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
File propsFile = new File('./gradle.properties') | |
if (!propsFile.exists()) { | |
propsFile.withWriterAppend { w -> w << 'android.enableBuildCache = false' } | |
} else { | |
Properties props = new Properties() | |
props.load(propsFile.newDataInputStream()) | |
props.setProperty('android.enableBuildCache', 'false') | |
props.store(propsFile.newWriter(), null) | |
} |
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
buildscript { | |
repositories { | |
maven { url 'https://maven.fabric.io/public' } | |
} | |
dependencies { | |
classpath 'io.fabric.tools:gradle:1.25.1' | |
} | |
} | |
apply plugin: 'com.android.application' |
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
version: "2" | |
services: | |
sonarqube: | |
image: sonarqube:6.7.1 | |
ports: | |
- "9000:9000" | |
networks: | |
- sonarnet | |
environment: |
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
version: 2 | |
jobs: | |
build: | |
dependencies: | |
pre: | |
- echo y | android update sdk --no-ui --all --filter "com.android.tools.build:gradle:3.0.1" | |
docker: | |
- image: circleci/android:api-26-alpha | |
environment: | |
JVM_OPTS: -Xmx3200m |
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 android.content.Context | |
import androidx.datastore.core.DataStore | |
import androidx.datastore.preferences.core.PreferenceDataStoreFactory | |
import androidx.datastore.preferences.core.Preferences | |
import androidx.datastore.preferences.core.edit | |
import androidx.datastore.preferences.core.stringPreferencesKey | |
import androidx.datastore.preferences.preferencesDataStoreFile | |
import androidx.test.core.app.ApplicationProvider | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.ExperimentalCoroutinesApi |
OlderNewer