Skip to content

Instantly share code, notes, and snippets.

View ragunathjawahar's full-sized avatar
🙂

Ragunath Jawahar ragunathjawahar

🙂
View GitHub Profile
@tfield
tfield / sdkman-vs-jenv.md
Last active March 24, 2024 11:36
SDKMAN vs JENV

sdkman vs jenv

Jenv is great, but the JDKs have to be manually installed. If you need more than just a couple of them, you'll want to be able to install them via command line, and sdkman provides this capability very cleanly for java. So... is it possible to work with both sdkman and jenv? Yes and no. Some tricks will allow you to tell jenv about the java versions that are managed by sdkman, but setting defaults (using jenv local 17.0 for instance) does not work very well. Time for a cleaner solution. Sdkman provides all of the same functionality, with more power and a slightly different (but equally simple) syntax. I've switched from jenv to sdkman. Here's my cheat sheet.

Setup

Download and install sdkman. Follow the required instructions after installing. Then, run the config command to enable auto_env support.

echo “Installing SDKMAN"
curl -s https://get.sdkman.io | bash
@DevSrSouza
DevSrSouza / GtkTheme.kt
Created July 4, 2021 19:00
Compose for Desktop get and listen to Gtk Dark/Light Theme changes
// implementation("org.zeroturnaround:zt-exec:1.12") LIBRARY USAGED
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import kotlin.coroutines.resume
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.flow
@arkivanov
arkivanov / Navigator.kt
Last active August 4, 2023 12:29
Compose-like navigation with Decompose
@Composable
fun <T : Parcelable> Navigator(
initialConfiguration: () -> T,
configurationClass: KClass<out T>,
content: @Composable Router<T>.(T) -> Unit
) {
val lifecycle = getLifecycle()
val stateKeeper = getStateKeeper()
val context = remember { DefaultComponentContext(lifecycle = lifecycle, stateKeeper = stateKeeper) }
@Beneboe
Beneboe / how-to-setup-verified-commits.md
Last active March 20, 2024 18:20
How to Setup Verified Commits on Github
@shauvik
shauvik / install-pre-commit.sh
Last active May 27, 2021 05:37 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/sh
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches.
# RUN THIS SCRIPT
# curl -fL https://gist.githubusercontent.com/shauvik/7175fa008bb29e83a86a6795159a893f/raw/install-pre-commit.sh | sh -s pre-commit-3
# Original stuff.
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below.
# Install in current Git repo:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
# coding: utf-8
# Imports
import os
import cPickle
import numpy as np
import theano
import theano.tensor as T
@wesbos
wesbos / commit-msg
Created July 4, 2016 18:55
ESLint 3.0 Git Pre Commit Hook
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
failed=0
for file in ${files}; do
@maybe-joe
maybe-joe / fx-listcell.css
Created April 5, 2016 04:50
Remove the selection effect and row colours from JavaFX Listview Listcells
.list-cell:filled:selected:focused,
.list-cell:filled:selected,
.list-cell:even,
.list-cell:odd {
-fx-background-color: transparent;
}
@KenVanHoeylandt
KenVanHoeylandt / build.gradle
Last active February 24, 2024 14:18
Gradle auto-installing pre-commit hook
apply from: rootProject.file('gradle/install-git-hooks.gradle')