Skip to content

Instantly share code, notes, and snippets.

View AfzalivE's full-sized avatar

Afzal Najam AfzalivE

View GitHub Profile
@AfzalivE
AfzalivE / gist:eea5918ac0c61eb08343
Last active August 29, 2015 14:24 — forked from ljubisa987/gist:e33cd5597da07172c55d
TextInputLayout with fixed "hints not showing"
package com.centralway.numbrs.numbrsapp.views;
import android.content.Context;
import android.graphics.Canvas;
import android.support.design.widget.TextInputLayout;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
/**
* A module for dependencies which require a {@link android.content.Context} or
* {@link android.app.Application} to create.
*/
@Module(
library = true
)
public class ContextModule {
private Context appContext;
@AfzalivE
AfzalivE / GuavaUtils.java
Last active April 1, 2016 18:52
Guava methods for todoapp-mvp
/*
* Copyright (C) 2007 The Guava Authors
*
* 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
@AfzalivE
AfzalivE / idea
Last active January 15, 2020 09:38 — forked from chrisdarroch/idea
Open/Import a gradle or idea project in Android Studio from your command line!
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/Android\ Studio.app | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
@AfzalivE
AfzalivE / Android CI
Created December 1, 2016 00:22 — forked from JvmName/Android CI
Android CI
#Android and CI and Gradle (A How-To)
There are tech stacks in this world that make it dead simple to integrate a <abbr title="Continuous Integration">CI</abbr> build system. <br>
The Android platform is not one of them.
Although Gradle is getting better, it's still a bit non-deterministic, and some of the fixes you'll need will start to feel more like black magic than any sort of programming.
But fear not! It can be done!
Before we embark on our journey, you'll need a few things to run locally:
@AfzalivE
AfzalivE / quotes.json
Last active February 20, 2023 19:59 — forked from signed0/quotes.json
json formatted quotes
[
{
"quote": "Life isn’t about getting and having, it’s about giving and being.",
"author": "Kevin Kruse"
},
{
"quote": "Whatever the mind of man can conceive and believe, it can achieve.",
"author": "Napoleon Hill"
},
{
@AfzalivE
AfzalivE / BottomSheetView.java
Last active March 13, 2017 03:16
DisableSwipeBottomSheetBehavior
public class BottomSheetView extends NestedScrollView {
private BottomSheetBehavior bottomSheetBehavior;
private RecyclerView devicesListV;
public BottomSheetView(Context context, AttributeSet attrs) {
super(context, attrs);
LayoutInflater.from(context).inflate(R.layout.bottom_sheet_view, this, true);
@AfzalivE
AfzalivE / asoundrc
Created November 14, 2017 01:16
Ps3 eye + 3.5mm speaker asoundrc
# ps3 eye + 3.5mm speaker Raspberry Pi
## Suggested by http://julius.sourceforge.jp/forum/viewtopic.php?f=9&t=66
## Modified by https://github.com/afzalive
pcm.jack {
type hw
card ALSA
}
pcm.array {
type hw
card CameraB409241

Keybase proof

I hereby claim:

  • I am afzalive on github.
  • I am afzal (https://keybase.io/afzal) on keybase.
  • I have a public key ASCEiRXUkvJrKqp2vh1X3N1jI9nKfF_liHnizkJSvnZFPAo

To claim this, I am signing this object:

@AfzalivE
AfzalivE / ConditionalTestRule.java
Last active January 28, 2019 15:42
Run test if a condition is true
import com.azimolabs.conditionwatcher.Instruction;
import org.junit.Assume;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import timber.log.Timber;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;