Skip to content

Instantly share code, notes, and snippets.

Avatar
😄

Sergio Casero Hernández sergiocasero

😄
View GitHub Profile
@rothgar
rothgar / streamyard-tampermonkey.js
Last active Dec 3, 2021
Streamyard Keyboard Shortcuts
View streamyard-tampermonkey.js
// ==UserScript==
// @name Streamyard Keyboard Shortcuts
// @namespace http://streamyard.com
// @version 0.1
// @description Simple keyboard shortcuts for streamyard
// @author justinleegarrison@gmail.com
// @match https://streamyard.com/*
// @grant none
// @run-at document-end
// ==/UserScript==
View ArgbEvaluator.java
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
karlrwjohnson / kotlin-js-spa.md
Created Sep 1, 2019
Customizing Kotlin/JS's Webpack configuration
View kotlin-js-spa.md

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
FireZenk / gzip.kts
Last active Nov 22, 2018 — forked from sgdan/gzip.kts
Kotlin code to compress/uncompress a string with gzip
View gzip.kts
import java.io.ByteArrayOutputStream
import java.io.File
import java.nio.charset.StandardCharsets.UTF_8
import java.util.zip.GZIPInputStream
import java.util.zip.GZIPOutputStream
fun String.gzip(): ByteArray {
val bos = ByteArrayOutputStream()
GZIPOutputStream(bos).bufferedWriter(UTF_8).use { it.write(this) }
return bos.toByteArray()
@raulraja
raulraja / Tagless.kt
Last active Jan 20, 2020
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 */
View RxGoogleAddressProvider.java
public interface AddressProvider {
int MAX_RESULTS = 1;
Observable<Map<String, String>> getRealAddressList(TripLocation... locationIds);
String getImmediateRealAddress(TripLocation tripLocation);
Observable<String> getRealAddress(TripLocation tripLocation);
}
@alexellis
alexellis / timelapse.md
Created Mar 9, 2017 — forked from porjo/timelapse.md
ffmpeg time-lapse
View timelapse.md

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
alxsimo / RxFirebaseRemoteConfig.java
Last active Dec 15, 2016
[Rx] RxFirebaseRemoteConfig
View RxFirebaseRemoteConfig.java
package com.milanuncios.milanunciosandroid.common.remoteconfig;
import com.alexsimo.toolbelt.optional.Optional;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings;
import com.milanuncios.milanunciosandroid.BuildConfig;
import java.util.Map;
import rx.AsyncEmitter;
import rx.Observable;
@sczerwinski
sczerwinski / MaterialColor.kt
Created Jul 22, 2016
Material Design colors palette in Kotlin
View MaterialColor.kt
package pl.info.czerwinski
enum class MaterialColor(val tones: Map<Int, Int> = emptyMap(), val accentTones: Map<Int, Int> = emptyMap(), val singleColor: Int? = null) {
RED(
tones = mapOf(
50 to 0xFFEBEE,
100 to 0xFFCDD2,
200 to 0xEF9A9A,
300 to 0xE57373,
400 to 0xEF5350,
@mlynch
mlynch / cordova-plugin-guide.md
Last active Dec 31, 2021
Cordova Plugin Developer Guide
View cordova-plugin-guide.md

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.

Introduction