Skip to content

Instantly share code, notes, and snippets.

View Manikkumar1988's full-sized avatar

Manikkumar Manikkumar1988

View GitHub Profile
@nathania
nathania / git_from_python_script.py
Created May 31, 2012 01:33
Execute git command from Python script
from subprocess import Popen, PIPE
from os import path
git_command = ['/usr/bin/git', 'status']
repository = path.dirname('/path/to/dir/')
git_query = Popen(git_command, cwd=repository, stdout=PIPE, stderr=PIPE)
(git_status, error) = git_query.communicate()
if git_query.poll() == 0:
# Do stuff
@rafali
rafali / BackgroundTransitionView.java
Last active September 16, 2017 09:51
Background transition on Android
TransitionDrawable transition = (TransitionDrawable) view.getBackground();
if (toggle) {
view.startTransition(1200);
} else {
view.reverseTransition(1200);
}
@ErikHellman
ErikHellman / Activity showing surface switch
Created June 22, 2013 09:17
A simple demo of playing a video on one SurfaceView and switching to another during playback.
package com.example.mediaplayersurfaceswitch;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
@laaptu
laaptu / SmoothInterpolator
Created September 17, 2013 07:52
Android smooth interpolator as per Cyril Mottier
//as per cyrilmottier.com/2012/05/22/the-making-of-prixing-fly-in-app-menu-part-1/
public class SmoothInterpolator extends LinearInterpolator {
@Override
public float getInterpolation(float input) {
return (float) Math.pow(input - 1, 5) + 1;
}
}
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 20, 2024 16:44
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@swenson
swenson / gist:cf74cd8e282443b43b8a
Created May 21, 2014 15:51
Google Interview Study Guide
Author unknown.
1.) Algorithm Complexity: You need to know Big-O. If you struggle with
basic big-O complexity analysis, then you are almost guaranteed not to
get hired.
For more information on Algorithms you can visit:
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=alg_index
2.) Coding: You should know at least one programming language really
well, and it should preferably be C++ or Java. C# is OK too, since
@malalanayake
malalanayake / ArrayList.java
Created June 15, 2014 01:53
ArrayList Implementation
import java.util.Arrays;
/**
* Simple ArrayList Implementation for Java Beginners
*
* @author malalanayake
*
*/
public class ArrayList {
private Object[] data;
@wwsun
wwsun / MyArrayList.java
Created May 7, 2015 08:32
A basic ArrayList implementation(Java)
package me.wwsun.list;
import java.util.Iterator;
/**
*
* @param <E> is the type of elements in this list
*/
public class MyArrayList<E> implements Iterable<E> {
@emanuelet
emanuelet / ExampleAdapter.java
Last active September 16, 2017 12:20
Generic List Adapter for Firebase
/**
* This class is an example of how to use FirebaseListAdapter. It uses the ExampleObject class to encapsulate the
* data for each individual chat message
*/
public class ExampleAdapter extends FirebaseListAdapter<ExampleObject> {
@InjectView(R.id.example_list_item)
TextView exampleView;
public DealListAdapter(Query ref, Activity activity, int layout) {
super(ref, ExampleObject.class, layout, activity);
@diegopacheco
diegopacheco / gradle-args.txt
Created July 30, 2015 17:32
How to get Parameters/Arguments in Gradle Command line / Console?
[build.gradle]
if ( project.hasProperty("myARG") ) {
// do something
} else {
// do something else
}
[CONSOLE]
$ gradle -PmyARG=true