This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Rect; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
/** | |
* An empty header (or footer) decoration for RecyclerView, since RecyclerView can't clipToPadding | |
*/ | |
public class SimpleHeaderDecoration extends RecyclerView.ItemDecoration { | |
private final int headerHeight; | |
private final int footerHeight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android.applicationVariants.all { variant -> | |
println "*********" + variant.description + "**********"; | |
def variants = variant.baseName.split("-"); | |
def apkName = "ricebook-"; | |
apkName += variants[0]; | |
apkName += "-v" + android.defaultConfig.versionName; | |
if (!variant.zipAlign) { | |
apkName += "-unaligned"; | |
} | |
if (variant.buildType.name == "release") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android.applicationVariants.all { variant -> | |
if (variant.install != null) { | |
variant.install.doLast { | |
exec { | |
commandLine "afplay", "your_sound.mp3" | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RoundedDrawable extends Drawable { | |
private static final boolean USE_VIGNETTE = true; | |
private RectF mRect = new RectF(); | |
private final Paint paint; | |
private final int mRadius; | |
private final BitmapShader bitmapShader; | |
public RoundedDrawable(Bitmap bitmap, int radius) { | |
bitmapShader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); | |
paint = new Paint(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env kscript | |
@file:DependsOn("com.squareup.okhttp3:okhttp:3.10.0") | |
@file:DependsOn("com.google.code.gson:gson:2.8.2") | |
@file:DependsOn("commons-cli:commons-cli:1.4") | |
import com.google.gson.Gson | |
import com.google.gson.JsonParser | |
import okhttp3.Interceptor | |
import okhttp3.Interceptor.Chain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import call | |
import sys | |
cmd = 'youtube-dl --extract-audio --audio-format mp3 --audio-quality 0'.split(' ') | |
url = sys.argv[1] | |
cmd.append(url) | |
print('running {}'.format(' '.join(cmd))) | |
call(cmd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from subprocess import call | |
import sys | |
cmd = 'youtube-dl --extract-audio --audio-format mp3 --audio-quality 0'.split(' ') | |
url = sys.argv[1] | |
cmd.append(url) | |
print('running {}'.format(' '.join(cmd))) | |
call(cmd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Header.RIFF | |
import okio.Buffer | |
import okio.BufferedSource | |
import okio.Okio | |
import java.io.File | |
class AVIFormat private constructor(val riff: ChunkGroup) { | |
val chunks by lazy { riff.spread() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import subprocess | |
import os | |
from os.path import basename | |
file = sys.argv[1] | |
command = ['ffmpeg', '-y'] | |
command.extend(['-i', file]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Usage: configure [options] | |
Options: [defaults in brackets after descriptions] | |
Standard options: | |
--help print this message | |
--logfile=FILE log tests and output to FILE [config.log] | |
--disable-logging do not log configure debug information | |
--prefix=PREFIX install in PREFIX [] | |
--bindir=DIR install binaries in DIR [PREFIX/bin] | |
--datadir=DIR install data files in DIR [PREFIX/share/ffmpeg] |
NewerOlder