Skip to content

Instantly share code, notes, and snippets.

View tamtom's full-sized avatar
👨‍💻
coding

Omar altamimi tamtom

👨‍💻
coding
View GitHub Profile
github.com:
- user: your github token handle
oauth_token: your github token
protocol: https
#!/bin/zsh
source ~/.bash_profile
branch=$(git rev-parse --abbrev-ref HEAD)
git push origin $branch
# Getting the task data from Jira API
response=$(curl -s "${jira_url}/rest/api/2/issue/$branch" -u "$jira_access_token" | sed 's#\\n##g;s#\\#\\\\#g')
base_branch=$1
@tamtom
tamtom / .bash_profile
Last active August 9, 2022 08:09
pull request automation Github + Jira
alias pr='the path of the script/pull_request.sh'
export jira_url=jira project base url
export jira_access_token=email:Jiratoken
export github_author=your github username
export github_reviewers=reviewers github handles,seperated,by,comma
@Composable
fun HostNavGraph(
startDestination: String = Splash.route) {
val navController = rememberNavController()
//..
}
dependencies {
implementation("androidx.navigation:navigation-compose:2.4.0-rc01")
}
// In your view model
private val _eventChannel = Channel<Event>(Channel.BUFFERED)
val events = _eventChannel.receiveAsFlow()
// Runs only on initial composition
LaunchedEffect(key1 = Unit) {
viewModel.eventsFlow.collectLatest { value ->
when(value) {
// Handle events
}
}
}
@Composable
fun LoginScreen //....
//....
Button(
onClick = {
action.invoke(Login)
}, modifier = Modifier
.fillMaxWidth()
.padding(top = 32.dp)
data class LoginState(
val isLoading: Boolean = false,
val isSuccess: Boolean = false,
val error: String? = null
)
val Colors.onSurfaceMedium: Color
@Composable
get() = if (isLight) SurfaceMediumLight else SurfaceMediumDark