Skip to content

Instantly share code, notes, and snippets.

View silverAndroid's full-sized avatar

Rushil Perera silverAndroid

View GitHub Profile
function get_os {
base=`uname`
if [ $base == 'Darwin' ]; then
brew install zsh zsh-completions;
elif [ $base == 'Linux' ]; then
os=`lsb_release -i | cut -f 2-`
if [ $os == 'Ubuntu' ]; then
sudo apt install zsh -y;
elif [ $os == 'Fedora' ]; then
sudo dnf install zsh -y;
@silverAndroid
silverAndroid / main.dart
Created December 9, 2017 18:35
Code with bottom nav that gets pushed up by the keyboard
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
@silverAndroid
silverAndroid / CastMediaItemConverter.kt
Last active August 24, 2025 13:01
How I got subtitles to work with CastPlayer
/** Copied [DefaultMediaItemConverter] but with subtitle support. */
@OptIn(UnstableApi::class)
class CastMediaItemConverter : MediaItemConverter {
private val KEY_MEDIA_ITEM = "mediaItem"
private val KEY_PLAYER_CONFIG = "exoPlayerConfig"
private val KEY_MEDIA_ID = "mediaId"
private val KEY_URI = "uri"
private val KEY_TITLE = "title"
private val KEY_MIME_TYPE = "mimeType"
private val KEY_DRM_CONFIGURATION = "drmConfiguration"