Skip to content

Instantly share code, notes, and snippets.

View FaizVisram's full-sized avatar

Faiz Visram FaizVisram

  • Faiz Visram
  • Toronto, Ontario, Canada
View GitHub Profile
@itsrishabh
itsrishabh / bash_batch
Last active August 29, 2015 14:08
Bash batch conversion from mp4 to png array, png array to gif, PNG array to gif with transparent background, Gif scale to certain size, PNG array in one directory to Gif, PNG array in one directory and crop, and Loop video x times
// Convert mp4 to png array
for f in *; do echo "Got '${f}'"; cd ${f}; mkdir ~/Desktop/frames/${f}; ffmpeg -i ${f}.mp4 -vf scale=600:-1 -r 29.97 ~/Desktop/frames/${f}/ffout_"${f%.mp4}%03d.png"; cd ..; done
// Convert png array to gif
for D in *; do echo "Got '${D}'"; cd ${D}; convert -dispose none -delay 3 -loop 0 ffout* ~/Desktop/gif/${D}.gif; cd ..; done
// Scale mp4 to png array at certain size
for f in *.mp4; do ffmpeg -i ${f} -vf scale=160:-1 -r 29.97 ~/Desktop/"${f}"; done
// PNG array to gif with transparent background
@kingargyle
kingargyle / LeanbackUtil.java
Created August 10, 2014 19:14
Check to see if an Android device supports the Leanback system feature
public class LeanbackUtil {
/**
* Returns true if the Leanback System feature is available otherwise false
*
* Can be used to help determine if running on an android tv device with the leanback launcher.
*/
public static boolean isLeanbackSupported(Context context) {
final PackageManager pm = context.getPackageManager();
return pm.hasSystemFeature("android.software.leanback");
}
@rafali
rafali / ResizeAnimation.java
Last active February 26, 2021 13:05
Resize animation on Android
public class ResizeAnimation extends Animation {
final int startWidth;
final int targetWidth;
View view;
public ResizeAnimation(View view, int targetWidth) {
this.view = view;
this.targetWidth = targetWidth;
startWidth = view.getWidth();
}