The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| /******************************************************************************* | |
| * Copyright (c) 2011 GitHub Inc. | |
| * All rights reserved. This program and the accompanying materials | |
| * are made available under the terms of the Eclipse Public License v1.0 | |
| * which accompanies this distribution, and is available at | |
| * http://www.eclipse.org/legal/epl-v10.html | |
| * | |
| * Contributors: | |
| * Kevin Sawicki (GitHub Inc.) - initial API and implementation | |
| *******************************************************************************/ |
| #! /usr/bin/env python | |
| # coding: utf-8 | |
| """This script reads all .java and .kt files from a directory tree and determines if | |
| it's necessary to write a Copyright Notice in the beginning of each Java file. | |
| It checks that by searching for the word "copyright" in the first few lines. | |
| Warning: use it at your own risk. Better have a source control to rollback if | |
| necessary. | |
| """ |
| #!/usr/bin/env bash | |
| # exit if fails | |
| set -o errexit | |
| set -o pipefail | |
| # reads the first arg as the file - expected list of file names without extension | |
| filename="${1:-}" | |
| # loops through each line | |
| while read -r line |
| package me.angrybyte.coloringdemo; | |
| import static android.graphics.PorterDuff.Mode.SRC_ATOP; | |
| import android.annotation.SuppressLint; | |
| import android.annotation.TargetApi; | |
| import android.content.Context; | |
| import android.content.res.ColorStateList; | |
| import android.graphics.Bitmap; |
| package com.scottyab.whatsnewplayground.data | |
| import android.content.Context | |
| import android.content.SharedPreferences | |
| import androidx.security.crypto.EncryptedSharedPreferences | |
| import androidx.security.crypto.MasterKeys | |
| import com.scottyab.whatsnewplayground.BuildConfig | |
| internal class SampleEncPrefs(context: Context) { |
| class MyAppFirebaseMessagingService : FirebaseMessagingService() { | |
| override fun onMessageReceived(remoteMessage: RemoteMessage) { | |
| if(remoteMessage.data.isNotEmpty()) { | |
| processNewMessage(remoteMessage.data) | |
| } | |
| } | |
| private fun processNewMessage(remoteMessageData: Map<String, String>) { | |
| if (BeaconPushNotificationsProcessor.isBeaconNotification(remoteMessageData)) { |
| name: Build and Deploy to Firebase | |
| 'on': | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build_and_deploy: | |
| name: Build and deploy Jekyll site | |
| runs-on: ubuntu-latest | |
| package ${PACKAGE_NAME} | |
| import com.nhaarman.mockitokotlin2.verify | |
| import com.nhaarman.mockitokotlin2.whenever | |
| import org.assertj.core.api.Assertions.assertThat | |
| import org.junit.Before | |
| import org.junit.Test | |
| import org.junit.runner.RunWith | |
| import org.mockito.Mock | |
| import org.mockito.junit.MockitoJUnitRunner |
| import org.assertj.core.api.AbstractObjectAssert | |
| @Suppress("UNCHECKED_CAST") | |
| inline fun <reified R> AbstractObjectAssert<*, *>.isNotInstanceOf(): AbstractObjectAssert<*, *>? = | |
| isNotInstanceOf(R::class.java) | |
| @Suppress("UNCHECKED_CAST") | |
| inline fun <reified R> AbstractObjectAssert<*, *>.isInstanceOf(): AbstractObjectAssert<*, *>? = | |
| isInstanceOf(R::class.java) |