Skip to content

Instantly share code, notes, and snippets.

@sebm
sebm / codecs.txt
Created January 20, 2012 21:35
All the codecs supported by ffmpeg
# From ffmpeg -codecs > codecs.txt
Codecs:
D..... = Decoding supported
.E.... = Encoding supported
..V... = Video codec
..A... = Audio codec
..S... = Subtitle codec
...S.. = Supports draw_horiz_band
@TurplePurtle
TurplePurtle / sourceFromFile.js
Created October 27, 2012 21:36
Load sound from local file for Web Audio API
// Audio Buffer Source
var fileInput = $("#audio-file");
bufferSource.gain.value = 1;
bufferSource.loop = true;
bufferSource.connect(oscillatorGain);
fileInput.addEventListener("change", function() {
var reader = new FileReader();
reader.onload = function(ev) {
context.decodeAudioData(ev.target.result, function(buffer) {
@benvd
benvd / UndoBarController.java
Created November 16, 2012 21:18
Roman Nurik's UndoBarController, using NineOldAndroids
/*
* Copyright 2012 Roman Nurik
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@barneycarroll
barneycarroll / mediaJQuery.css
Created March 26, 2013 12:52
Javascript to emulate media queries with event firing and HTML class toggling to avoid duplication, conflict & waste in native CSS implementation + JS feature dependency. Public version of a private gist created 2012-09-13T11:34:06Z
/* Javascript to emulate media queries with events and HTML class toggling
* to avoid duplication, conflict & waste when implemented via
* native CSS implementation + JS feature dependency.
*
* Depends on jQuery and Cowboy's throttle / debounce plugin:
* https://github.com/cowboy/jquery-throttle-debounce
*/
(function(){
var options = {
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package com.frogsparks.mytrails.util;
import android.os.Environment;
import com.frogsparks.mytrails.MyTrails;
import java.io.File;
import java.util.*;
// http://stackoverflow.com/a/15612964/304876
@jacobtabak
jacobtabak / PicassoVideoFrameRequestHandler.java
Last active March 11, 2017 11:39
Picasso Video Frame RequestHandler
import android.graphics.Bitmap;
import android.media.MediaMetadataRetriever;
import com.squareup.picasso.Picasso;
import com.squareup.picasso.Request;
import com.squareup.picasso.RequestHandler;
import java.io.IOException;
@joeykrim
joeykrim / gist:5dbd7a685b8d057182e4
Created June 11, 2015 18:25
AdMob Mediation Workaround for Smart Banner Ad Types
//Constants for tablet sized ads (728x90)
//AdMob name: LEADERBOARD
final int IAB_LEADERBOARD_WIDTH = 728;
final int IAB_LEADERBOARD_HEIGHT = 90;
//AdMob name: FULL_BANNER
final int MED_BANNER_WIDTH = 480;
final int MED_BANNER_HEIGHT = 60;
//Constants for phone sized ads (320x50)
//AdMob name: BANNER
final int BANNER_AD_WIDTH = 320;
@shliama
shliama / gist:bf30566d7c7202a4e0ab
Created June 22, 2015 14:51
ffmpeg audio-only decoders, demuxers, parsers
--enable-decoder=aac,aac,aac_latm,ac3,adpcm_4xm,adpcm_adx,adpcm_afc,adpcm_ct,adpcm_dtk,adpcm_ea,adpcm_ea,adpcm_ea,adpcm_ea_r1,adpcm_ea,adpcm_ea_r2,adpcm_ea,adpcm_ea_r3,adpcm_ea,adpcm_ea_xas,adpcm_g722,adpcm_g726,adpcm_g726,adpcm_g726le,adpcm_ima_amv,amv,adpcm_ima_apc,adpcm_ima_dk3,adpcm_ima_dk4,adpcm_ima_ea_eacs,adpcm_ima_ea_sead,adpcm_ima_iss,adpcm_ima_oki,adpcm_ima_qt,adpcm_ima_rad,adpcm_ima_smjpeg,mjpeg,adpcm_ima_wav,adpcm_ima_ws,adpcm_ms,adpcm_sbpro_2,adpcm_sbpro_3,adpcm_sbpro_4,adpcm_swf,adpcm_thp,thp,adpcm_vima,vima,adpcm_xa,adpcm_yamaha,alac,ape,atrac1,ac3,atrac3,ac3,atrac3,atrac3p,bink,binkaudio_dct,bink,binkaudio_rdft,bmv_audio,comfortnoise,cook,dsd_lsbf,dsd_lsbf,dsd_lsbf_planar,dsd_msbf,dsd_msbf,dsd_msbf_planar,sicinaudio,ac3,eac3,evrc,flac,g723_1,g729,gsm,gsm,gsm_ms,iac,imc,interplay_dpcm,mace3,mace6,metasound,mlp,mp1,mp2,mp3,mp3,mp3adu,mp3,p3on4,als,nellymoser,opus,paf_audio,pcm_alaw,pcm_bluray,pcm_dvd,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_lxf,pcm_mulaw,pcm_s16be,pcm_s16be,pcm_s16be_planar,p
@jemshit
jemshit / text_colors.xml
Last active March 21, 2021 01:07
Android Text Colors according to Material Design Pattern
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Dark Text Color for Light Background -->
<color name="textDarkPrimary">#DE000000</color> <!--DE for %87 opacity-->
<color name="textDarkSecondary">#8A000000</color> <!--8A for %54 opacity-->
<color name="textDarkDisabled">#61000000</color> <!--61 for %38 opacity-->
<!-- White Text Color for Dark Background -->
<color name="textLightPrimary">#FFFFFF</color> <!--%100 opacity-->