Skip to content

Instantly share code, notes, and snippets.

@Felk
Felk / ffmpeg_example.py
Last active May 21, 2020 20:24
example of lightweight ffmpeg wrapper in python
pipeline = ffmpeg.Pipeline()
silence, = pipeline.input(Filter("aevalsrc", 0, 1, filter_options=[ # using anullsrc corrupts the audio
"0", "channel_layout=stereo", "sample_rate=44100"
]))
color, = pipeline.input(Filter("color", 0, 1, filter_options=[
"color=0x009999",
"duration=" + str(duration),
"rate=" + str(config.framerate),
"size=1920x1080",
]))
@mannodermaus
mannodermaus / CompatTextView.java
Last active August 30, 2018 09:59
Custom TextView implementation to allow VectorDrawableCompat to work with compound Drawables
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.AppCompatDrawableManager;
import android.support.v7.widget.AppCompatTextView;
import android.util.AttributeSet;
@EricKuck
EricKuck / ButterknifeConductor.kt
Last active May 9, 2019 20:30
Kotterknife(ish) view binding for Conductor controllers
// Largely borrowed from Jake Wharton's Kotterknife (https://github.com/JakeWharton/kotterknife)
// and paweljaneczek's PR for resetting cached views (https://github.com/JakeWharton/kotterknife/pull/37)
package com.bluelinelabs.conductor.butterknife
import android.view.View
import com.bluelinelabs.conductor.Controller
import java.util.Collections
import java.util.WeakHashMap
import kotlin.properties.ReadOnlyProperty
@vedant1811
vedant1811 / Spinner.java
Created January 6, 2015 19:16
Custom Spinner to differentiate between user selected and prorammatically selected item. Make sure to call correct method to use this feature
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.AdapterView;
/**
* Used this to differentiate between user selected and prorammatically selected
* Call {@link Spinner#programmaticallySetPosition} to use this feature.
* Created by vedant on 6/1/15.