This file contains hidden or 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 Analytics constructor( | |
| private val platforms: Set<AnalyticsPlatform> | |
| ... | |
| ) { | |
| fun logEvent(appEvent: AppEvent) { | |
| platforms.forEach { it.onEvent(appEvent) } | |
| } | |
| } |
This file contains hidden or 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
| generate-dependency-graph: | |
| name: Generate Dependency Graph | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Setup Graphviz | |
| uses: ts-graphviz/setup-graphviz@v1 |
This file contains hidden or 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 MainActivity : AppCompatActivity() { | |
| override fun attachBaseContext(base: Context) { | |
| val configuration = Configuration().also { | |
| it.setToDefaults() | |
| } | |
| configuration.setLocale(Locale("ru", "RU")) |
This file contains hidden or 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
| #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME} | |
| #end | |
| #parse("File Header.java") | |
| #if ($NAME.toString().contains("Test"))import org.junit.Assert.* | |
| #end | |
| class ${NAME} { |
This file contains hidden or 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
| task runActivity(dependsOn: "installDebug", type: Exec) { | |
| workingDir "./" | |
| commandLine 'adb', 'shell', 'am start -n package.name/.relative.path.from.package.name.ActivityName' | |
| } |
This file contains hidden or 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
| # | |
| # Working with branches | |
| # | |
| # Get the current branch name (not so useful in itself, but used in | |
| # other aliases) | |
| branch-name = "!git rev-parse --abbrev-ref HEAD" | |
| # Push the current branch to the remote "origin", and set it to track | |
| # the upstream branch | |
| publish = "!git push -u origin $(git branch-name)" |
This file contains hidden or 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
| private static String getHexBytesString(byte[] bytes) { | |
| StringBuilder sb = new StringBuilder(); | |
| for (byte b : bytes) { | |
| sb.append(String.format("%02X ", b)); | |
| } | |
| return sb.toString(); | |
| } |
This file contains hidden or 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
| #!/bin/bash | |
| service=dropbox-lnx.x86_64-3.20.1 | |
| if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 )) | |
| then | |
| echo "$service is running, all is well" | |
| else | |
| .dropbox-dist/dropboxd & | |
| fi |
This file contains hidden or 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
| /* | |
| * Copyright (C) 2016 Jeff Gilfelt. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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 main; | |
| public class Main { | |
| private static double getDistanceKm(double lat1, double lon1, double lat2, double lon2){ | |
| double latRad1 = lat1 * Math.PI / 180; | |
| double lonRad1 = lon1 * Math.PI / 180; | |
| double latRad2 = lat2 * Math.PI / 180; | |
| double lonRad2 = lon2 * Math.PI / 180; |
NewerOlder