Skip to content

Instantly share code, notes, and snippets.

@rpattabi
rpattabi / FakeToucher.java
Last active May 31, 2016 07:23
Android - Fake toucher to prevent CPU scaling down due to user inactivity. UPDATE: This doesn't help! :--( Android understands that these fake touches are not coming from user and continues to scale down the CPU.
import android.os.SystemClock;
import android.support.annotation.NonNull;
import android.view.MotionEvent;
import android.view.View;
import java.util.Timer;
import java.util.TimerTask;
/*
NOTE
@rpattabi
rpattabi / espresso_fullscreen_click_error
Created March 29, 2015 01:20
espresso fullscreen click error
android.support.test.espresso.PerformException: Error performing 'single click' on view 'with id: com.example.espressodefect:id/fullscreen_content'.
at android.support.test.espresso.PerformException$Builder.build(PerformException.java:83)
at android.support.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:70)
at android.support.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:53)
at android.support.test.espresso.ViewInteraction.runSynchronouslyOnUiThread(ViewInteraction.java:185)
at android.support.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:115)
at android.support.test.espresso.ViewInteraction.perform(ViewInteraction.java:87)
at com.example.espressodefect.FullscreenActivityTest.testClickingOnLayout(FullscreenActivityTest.java:21)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
@rpattabi
rpattabi / 7in7_Io.markdown
Last active August 29, 2015 14:07
Seven Languages in Seven Weeks - Io Language

Io Language

Day 2 Self-Study

1 Fibonacci

fib := method(n,
  if(n==0, 0,
     if(n==1, 1,
        fib(n-1)+fib(n-2)))
#Sample code
#Hello world
"Hello world!" print
#Factorial
factorial := method(n, if(n == 1, 1, n * factorial(n - 1)))
99 bottles of beer
@rpattabi
rpattabi / .vimrc
Created August 29, 2014 15:05
.vimrc
set dictionary+=~/.vim/roget13a.txt
set thesaurus+=~/.vim/mthesaur.txt
""
"" Janus setup
""
" Define paths
let g:janus_path = escape(fnamemodify(resolve(expand("<sfile>:p")), ":h"), ' ')
let g:janus_vim_path = escape(fnamemodify(resolve(expand("<sfile>:p" . "vim")), ":h"), ' ')

Setup

Download is here at vim.org for Windows.

Configuration

theme

moloki @ here

@rpattabi
rpattabi / firebug_notes.md
Created September 30, 2012 16:45
HTML5 & CSS3 - Notes from what I learned using firebug
@rpattabi
rpattabi / howto_git-tfs.md
Created September 24, 2012 15:39
Using git to work with TFS

Introduction

There is an excellent adapter for git <--> tfs interaction. It is called git-tfs. Using this I could use my favorite git efficiently. Once I am done with my work I could push to tfs. This gist explains the steps I followed and brief git tfs command reference.

Installation

Run the below as Admin

@rpattabi
rpattabi / study_notes_coffeescript_full.md
Created September 19, 2012 15:27
Coffee Script Study Notes -- FULL

CoffeeScript study notes

references

basics

  • compiles into javascript
  • encourages good use of javascript's good parts
@rpattabi
rpattabi / study_notes_coffeescript.md
Created September 15, 2012 05:42
CoffeeScript Study Notes

CoffeeScript study notes

references

basics

  • compiles into javascript
  • encourages good use of javascript's good parts