// bad example
async.paralell([function(callback) {
getUserPhotos().then((data) => callback(null, data), callback)
}, function(callback) {
logClickToAnalytics().then((data) => callback(null, data)).catch(callback)
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
/** | |
* Kotlin Extensions for simpler, easier and funw way | |
* of launching of Activities | |
*/ | |
inline fun <reified T : Any> Activity.launchActivity ( | |
requestCode: Int = -1, | |
options: Bundle? = null, | |
noinline init: Intent.() -> Unit = {}) | |
{ |
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
node { | |
stage 'Checkout' | |
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/abnormallydriven/android-ci-example.git']]]) | |
sh "./gradlew clean" | |
stage 'Unit Test' | |
sh "./gradlew 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
package com.cjtp.android.api.interceptors; | |
import android.util.Log; | |
import com.google.gson.JsonObject; | |
import com.inviteez.android.core.Session; | |
import com.inviteez.android.utils.Constant; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.io.IOException; |
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 cors = require('cors')({origin: true}); | |
exports.sample = functions.https.onRequest((req, res) => { | |
cors(req, res, () => { | |
res.send('Passed.'); | |
}); | |
}); |
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
// module level build.gradle dependencies | |
compile 'com.squareup.picasso:picasso:2.5.2' | |
compile 'com.squareup.okhttp3:okhttp:3.4.2' | |
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2' | |
// imports | |
import com.jakewharton.picasso.OkHttp3Downloader; | |
import com.squareup.picasso.Picasso; | |
import java.io.IOException; |
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
#!/usr/bin/groovy | |
/* | |
* Copyright (c) 2016, Andrey Makeev <amaksoft@gmail.com> | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* 1. Redistributions of source code must retain the above copyright |
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 interface IModuleImport { | |
(authOptions?: IAuthOptions): IGCloud; | |
} | |
export interface IAuthOptions { | |
projectId?: string; | |
keyFilename?: string; | |
} |
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: 'com.android.application' | |
android { | |
compileSdkVersion rootProject.ext.compileSdkVersion | |
buildToolsVersion rootProject.ext.buildToolsVersion | |
defaultConfig { | |
applicationId "com.example.yourapp" | |
minSdkVersion 16 | |
targetSdkVersion 23 |
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
Spinner spinner = (Spinner) findViewById(R.id.main_spinner); | |
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getSupportActionBar().getThemedContext(), | |
R.layout.spinner_list_style, | |
getResources().getStringArray(R.array.countries)); | |
spinnerAdapter.setDropDownViewResource(R.layout.spinner_dropdown_item); | |
spinner.setAdapter(spinnerAdapter); |
NewerOlder