Skip to content

Instantly share code, notes, and snippets.

View nuhkoca's full-sized avatar
🇩🇪
In Berlin

Nuh Koca nuhkoca

🇩🇪
In Berlin
View GitHub Profile
@nuhkoca
nuhkoca / TTSDemo.kt
Created May 9, 2021 14:09
TTS setup with any language
import android.os.Bundle
import android.speech.tts.TextToSpeech
import android.speech.tts.TextToSpeech.*
import android.widget.Toast
import android.widget.Toast.LENGTH_LONG
import androidx.appcompat.app.AppCompatActivity
import com.example.ttsdemo.databinding.ActivityMainBinding
import java.util.*
class MainActivity : AppCompatActivity() {
@nuhkoca
nuhkoca / HiltDataBinding.kt
Last active February 26, 2024 16:33
A demonstration about how to inject BindingAdapters with Dagger Hilt.
BindingScoped.kt
@Scope
@Retention(AnnotationRetention.BINARY)
annotation class BindingScoped
-------------------------------------------------------
CustomBindingComponent.kt
The year is 20XX.
Everyone plays Fox at TAS levels of perfection.
Because of this, the winner of a match depends solely on port priority.
The RPS metagame has evolved to ridiculous levels due to it being the only remaining factor to decide matches.
@nuhkoca
nuhkoca / undefined
Last active May 7, 2024 23:31
⚡️ Recent activity
🎉 Merged PR #214 in nuhkoca/FirebaseFunctions
🎉 Merged PR #102 in nuhkoca/udacity-movie-app
🎉 Merged PR #103 in nuhkoca/udacity-movie-app
🎉 Merged PR #170 in nuhkoca/libbra
🎉 Merged PR #143 in nuhkoca/HiltDataBindingSample
@nuhkoca
nuhkoca / create-jenkins-user.sh
Created November 17, 2019 23:24
Create Jenkins User Script
JENKINS_HOMEDIR="/Users/Shared/Jenkins"
DEFAULTS_PLIST="/Library/Preferences/org.jenkins-ci.plist"
if dscl . -list /Users/jenkins; then
echo 'jenkins user already exists, attempting to change the shell to /bin/bash'
# Will fail if UserShell is not /usr/bin/false, but that's ok.
# Then we will assume an admin has changed it.
dscl . -change /Users/jenkins UserShell /usr/bin/false /bin/bash
else
echo 'No jenkins user found, creating jenkins user and group'
@nuhkoca
nuhkoca / linguist-runner.sh
Created November 11, 2019 13:36 — forked from burntcookie90/linguist-runner.sh
runs linguist on ever commit since a date
#!/usr/bin/bash
for commit in $(git --no-pager log --reverse --after="2016-10-01T10:36:00-07:00" --pretty=format:%H)
do
echo $commit
git checkout $commit
#write linguist data to a file
echo "" >> ~/repo-linguist-report.txt
echo "commit: $commit" >> ~/repo-linguist-report.txt
@Binds
abstract fun providePrinter(networkPrinter: NetworkPrinter) = Printer
/**
* A [Module] that injects ExoPlayer
*
* @author nuhkoca
*/
@Module
class ExoModule {
/**
* Provides the user agent for the device
@Module
public class ExoModule {
/**
* Provides the user agent for the device
*
* @param context represents an instance of {@link Context}
* @return an instance of user agent
*/
@Singleton
/**
* Copyright Google Inc. All Rights Reserved.
* <p/>
* 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software