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
var osnURL = "https://osn-fusioncrm.oracle.com/osn/social/api/v1"; | |
var defaultNotificationDuration = 5000; | |
var loggedUserId; | |
var previousTabId=-1, previousData=[]; | |
function showNotification(userID, titleTxt, bodyTxt) { | |
if (window.webkitNotifications) { | |
console.log("Notifications are supported!"); | |
var notification = window.webkitNotifications.createNotification( | |
osnURL+"/pictures/"+userID+"/profile", // The image. |
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=/System/Library/Java/JavaVirtualMachines/1.5.0/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
function sendFormEmail() { | |
var toEmailAddress = "[email protected]"; | |
var htmlMessage = HtmlService.createHtmlOutputFromFile("Name-of-your-HTML-file.html").getContent(); | |
var subject = "Subject"; | |
var message = "Some message"; | |
MailApp.sendEmail(toEmailAddress, subject, message, { | |
htmlBody: htmlMessage | |
}); | |
} |
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
function unreadCount() { | |
var unreadCount = GmailApp.getInboxUnreadCount(); | |
var masterEmail = "<[email protected]>"; | |
var subject = "Your unread count"; | |
var message = "You have " + unreadCount + " emails" | |
MailApp.sendEmail(masterEmail, subject, message); | |
} |
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
fun fetchMergeRequestsChannel(gitLabService: GitLabService, lastProductionSha: String): ReceiveChannel<MergeRequest> { | |
return produce { | |
var page = 1 | |
while (true) { | |
gitLabService.delayedFetchMergeRequests(page++).forEach { send(it) } | |
} | |
}.takeWhile { it.commitSha != lastProductionSha } | |
} | |
fun main(args: Array<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: "jacoco” | |
jacocoTestCoverageVerification { | |
violationRules { | |
rule { | |
limit { | |
minimum = 0.79 | |
} | |
} | |
} |
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
jacocoTestCoverageVerification { | |
afterEvaluate { | |
classDirectories = files(classDirectories.files.collect { | |
fileTree(dir: it, exclude: [ | |
'com/example/my/package/*', | |
'com/example/service/MyApplication.kt', | |
'com/google/protobuf/*' | |
]) | |
}) | |
} |
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
jacocoTestCoverageVerification { | |
violationRules { | |
rule { | |
excludes = [ | |
'com/example/my/package/*', | |
'com/example/service/MyApplication.kt', | |
'com/google/protobuf/*' | |
] | |
limit { | |
minimum = 0.79 |
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.collections | |
inline fun <T> Array<out T>.takeWhileInclusive( | |
predicate: (T) -> Boolean | |
): List<T> { | |
var shouldContinue = true | |
return takeWhile { | |
val result = shouldContinue | |
shouldContinue = predicate(it) | |
result |
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
class Person() { | |
private lateinit var _other: Person | |
private constructor(_other: Person) : this() { | |
this._other = _other | |
} | |
val other: Person | |
get() { | |
if (!::_other.isInitialized) { |
OlderNewer