This file contains hidden or 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
| #!/bin/bash | |
| function psg() | |
| { | |
| /bin/ps aux | grep -v 'grep' |grep -i $1 | |
| } | |
| function len() | |
| { | |
| string=$1 |
This file contains hidden or 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
| ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json" |
This file contains hidden or 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.PointF; | |
| import android.view.animation.Animation; | |
| import android.view.animation.Transformation; | |
| // http://www.math.ubc.ca/~cass/gfx/bezier.html | |
| public class ArcTranslateAnimation extends Animation { | |
| private int mFromXType = ABSOLUTE; | |
| private int mToXType = ABSOLUTE; |
This file contains hidden or 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
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>App Redirection</title> | |
| </head> | |
| <body> | |
| <!-- | |
| NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom | |
| protocol handlers. |
This file contains hidden or 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 CheckableFrameLayout extends FrameLayout implements Checkable { | |
| private static final int[] CHECKED_STATE_SET = { | |
| android.R.attr.state_activated, | |
| android.R.attr.state_checked, | |
| }; | |
| private boolean mChecked; | |
| public CheckableFrameLayout(Context context) { | |
| super(context); |
This file contains hidden or 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
| // Copyright 2012 Square, Inc. | |
| package com.squareup.widgets; | |
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.util.AttributeSet; | |
| import android.widget.ImageView; | |
| /** Maintains an aspect ratio based on either width or height. Disabled by default. */ | |
| public class AspectRatioImageView extends ImageView { |
This file contains hidden or 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 SimpleHTTPServer | |
| class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
| def send_head(self): | |
| """Common code for GET and HEAD commands. | |
| This sends the response code and MIME headers. | |
| Return value is either a file object (which has to be copied | |
| to the outputfile by the caller unless the command was HEAD, | |
| and must be closed by the caller under all circumstances), or |
This file contains hidden or 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
| package com.squareup.widgets; | |
| import android.content.Context; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| import android.widget.ViewAnimator; | |
| /** ViewAnimator helper which allows setting the selected child by ID rather than index. */ | |
| public class SquareViewAnimator extends ViewAnimator { | |
| public SquareViewAnimator(Context context) { |
This file contains hidden or 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
| /** | |
| * Execute an {@link AsyncTask} on a thread pool. | |
| * | |
| * @param task Task to execute. | |
| * @param args Optional arguments to pass to {@link AsyncTask#execute(Object[])}. | |
| * @param <T> Task argument type. | |
| */ | |
| public static <T> void execute(AsyncTask<T, ?, ?> task, T... args) { | |
| if (Build.VERSION.SDK_INT < Build.VERSION_CODES.DONUT) { | |
| throw new UnsupportedOperationException("This class can only be used on API 4 and newer."); |
This file contains hidden or 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.content.Context; | |
| import android.support.v4.view.ViewPager; | |
| import android.util.AttributeSet; | |
| import android.view.GestureDetector; | |
| import android.view.GestureDetector.SimpleOnGestureListener; | |
| import android.view.MotionEvent; | |
| /** | |
| * Custom {@link ViewPager} implementation that will handle horizontal scroll events by himself. Default ViewPager | |
| * becomes hardly usable when it's nested into ScrollView based containers (such as ScrollView, ListView, etc.). It is |