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 sys | |
import numpy | |
import struct | |
f = sys.argv[1] | |
avg = lambda f: numpy.mean(numpy.absolute(numpy.fromfile(f, '<f4')), dtype=numpy.float64) | |
print('average of %s: %.16f' % (f, avg(f))) |
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 rp = require('request-promise-native') | |
const slackToken = '<SLACK TOKEN>' | |
const bitriseToken = '<BITRISE API TOKEN>' | |
const baseBitriseData = { | |
hook_info: { | |
type: 'bitrise', | |
build_trigger_token: bitriseToken | |
}, |
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
val assetFactory = DataSource.Factory { AssetDataSource(context) } | |
val source = ProgressiveMediaSource.Factory(assetFactory).createMediaSource(Uri.parse("assets:///alarm_sound_1.mp3")) | |
val exo = SimpleExoPlayer.Builder(context).build().apply { | |
repeatMode = Player.REPEAT_MODE_ALL | |
volume = 1f | |
audioAttributes = AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MUSIC).build() | |
prepare(source) | |
playWhenReady = true | |
} |
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.app.Activity; | |
import android.content.Context; | |
import android.content.ContextWrapper; | |
import android.support.annotation.LayoutRes; | |
import android.util.AttributeSet; | |
import android.view.LayoutInflater; | |
import android.view.ViewGroup; | |
import android.widget.FrameLayout; | |
import android.widget.ScrollView; | |
import android.widget.TextView; |
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
// Generate a minor version code from git commit count (for prod builds) | |
static def generateVersionCode() { | |
def result = "git rev-list HEAD --count".execute().text.trim() //unix | |
if(result.empty) result = "PowerShell -Command git rev-list HEAD --count".execute().text.trim() //windows | |
if(result.empty) throw new RuntimeException("Could not generate versioncode on this platform? Cmd output: ${result.text}") | |
return result.toInteger() | |
} | |
def majorVersion = 1 |
OlderNewer