Skip to content

Instantly share code, notes, and snippets.

View freszu's full-sized avatar
👨‍💻

Rafał Naniewicz freszu

👨‍💻
View GitHub Profile
@freszu
freszu / GiftAdventCalendarMachine.kt
Created December 7, 2022 18:27
Generates list of other participants each person have to give a gift to every day.
import java.io.File
/**
* Advent calendar gift generator
*
* Generates list of other participants each person have to give a gift to every day.
*/
fun main() {
println("Pass a list of participants separated by \",\"")
val santas: List<String> = readln().split(',')
@freszu
freszu / toggleFunctionAppTouchbar.sh
Last active February 2, 2020 21:37
Simple bash script to toggle system preferences for Touchbar shows between "App controls" and "Show F1, F2, etc. Keys"
#!/bin/bash
function readCurrent(){
local current=$(defaults read com.apple.touchbar.agent PresentationModeGlobal)
echo "$current"
}
function setCurrent(){
defaults write com.apple.touchbar.agent PresentationModeGlobal -string $1
pkill "ControlStrip"
}
@freszu
freszu / toggleFunctionAppTouchbar.sh
Created February 2, 2020 21:37
Simple bash script to toggle system preferences for Touchbar shows between "App controls" and "Show F1, F2, etc. Keys
#!/bin/bash
function readCurrent(){
local current=$(defaults read com.apple.touchbar.agent PresentationModeGlobal)
echo "$current"
}
function setCurrent(){
defaults write com.apple.touchbar.agent PresentationModeGlobal -string $1
pkill "ControlStrip"
}
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import io.reactivex.android.plugins.RxAndroidPlugins;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.schedulers.Schedulers;
public class RxSchedulersOverrideRule implements TestRule {