Skip to content

Instantly share code, notes, and snippets.

View sergiocasero's full-sized avatar

Sergio Casero Hernández sergiocasero

View GitHub Profile
rothgar / streamyard-tampermonkey.js
Last active December 3, 2021 16:40
Streamyard Keyboard Shortcuts
View streamyard-tampermonkey.js
// ==UserScript==
// @name Streamyard Keyboard Shortcuts
// @namespace
// @version 0.1
// @description Simple keyboard shortcuts for streamyard
// @author
// @match*
// @grant none
// @run-at document-end
// ==/UserScript==
public Object evaluate(float fraction, Object startValue, Object endValue) {
int startInt = (Integer) startValue;
float startA = ((startInt >> 24) & 0xff) / 255.0f;
float startR = ((startInt >> 16) & 0xff) / 255.0f;
float startG = ((startInt >> 8) & 0xff) / 255.0f;
float startB = ( startInt & 0xff) / 255.0f;
int endInt = (Integer) endValue;
float endA = ((endInt >> 24) & 0xff) / 255.0f;
float endR = ((endInt >> 16) & 0xff) / 255.0f;
karlrwjohnson /
Created September 1, 2019 18:51
Customizing Kotlin/JS's Webpack configuration

This is mostly notes to myself in case I ever do this again.

So, I've been doing a lot of frontend development in Typescript/React, but I'm also interested in Kotlin. I'm a full-stack engineer, so the idea of making a whole application in the same language appeals to me. (I'm aware that backend development in NodeJS exists, but I'm a fan of strict typing.)

So I've been exploring Kotlin's JS backend support.

So anyways, here's how my project is set up right now:

FireZenk / gzip.kts
Last active November 22, 2018 15:09 — forked from sgdan/gzip.kts
Kotlin code to compress/uncompress a string with gzip
View gzip.kts
import java.nio.charset.StandardCharsets.UTF_8
fun String.gzip(): ByteArray {
val bos = ByteArrayOutputStream()
GZIPOutputStream(bos).bufferedWriter(UTF_8).use { it.write(this) }
return bos.toByteArray()
raulraja / Tagless.kt
Last active January 20, 2020 15:53
Tagless in Kotlin with Arrow and manual DI
View Tagless.kt
import arrow.Kind
import arrow.core.Option
import arrow.core.Try
import arrow.core.functor
import arrow.effects.IO
import arrow.effects.fix
import arrow.effects.functor
import arrow.typeclasses.Functor
/* algebras */
mgdiez /
Last active November 6, 2017 15:07
Rx Geocoder
public interface AddressProvider {
int MAX_RESULTS = 1;
Observable<Map<String, String>> getRealAddressList(TripLocation... locationIds);
String getImmediateRealAddress(TripLocation tripLocation);
Observable<String> getRealAddress(TripLocation tripLocation);
alexellis /
Created March 9, 2017 08:48 — forked from porjo/
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality

alxsimo /
Last active December 15, 2016 16:42
[Rx] RxFirebaseRemoteConfig
package com.milanuncios.milanunciosandroid.common.remoteconfig;
import com.alexsimo.toolbelt.optional.Optional;
import com.milanuncios.milanunciosandroid.BuildConfig;
import java.util.Map;
import rx.AsyncEmitter;
import rx.Observable;
sczerwinski / MaterialColor.kt
Created July 22, 2016 14:04
Material Design colors palette in Kotlin
View MaterialColor.kt
enum class MaterialColor(val tones: Map<Int, Int> = emptyMap(), val accentTones: Map<Int, Int> = emptyMap(), val singleColor: Int? = null) {
tones = mapOf(
50 to 0xFFEBEE,
100 to 0xFFCDD2,
200 to 0xEF9A9A,
300 to 0xE57373,
400 to 0xEF5350,
mlynch /
Last active February 3, 2023 00:21
Cordova Plugin Developer Guide

Cordova Plugin Development Guide (iOS and Android)

Version: 0.0.1 updated 7/1/2016

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

Building Cordova plugins is scary for many Cordova and Ionic developers, but it doesn't have to be. This simple guide walks through the what, when, why, and how of Cordova plugin development for iOS and Android.