⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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.pivotallabs; | |
import android.util.Log; | |
import com.xtremelabs.robolectric.Robolectric; | |
import com.xtremelabs.robolectric.RobolectricTestRunner; | |
import com.xtremelabs.robolectric.util.Implements; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
@RunWith(RobolectricTestRunner.class) |
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 CodeSlap - Cristian Castiblanco | |
* | |
* 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 |
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
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
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/sh | |
# Use SourceGear DiffMerge as mergetool for git in cygwin. | |
# git config --global mergetool.diffmerge.cmd "diffmergetool.sh \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\"" | |
# git config --global mergetool.diffmerge.trustExitCode false | |
# git difftool -t diffmerge branch1..branch2 | |
# Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf | |
library=githelperfunctions.sh |
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
@Test | |
public void buttonClickShouldStartNewActivity() throws Exception | |
{ | |
Button button = activity.findViewById( R.id.next_screen_button ); | |
button.performClick(); | |
Intent intent = NewActivity.createIntent( activity ); | |
assertThat( activity, new StartedMatcher( intent ) ); | |
} |
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
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification | |
apply plugin: 'android' | |
targetCompatibility = 1.6 | |
sourceCompatibility = 1.6 | |
android { | |
target = 'android-14' |
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 javax.crypto.spec.SecretKeySpec | |
import javax.crypto.Cipher | |
import org.apache.commons.codec.binary.Base64 | |
def encrypt(encrypt,en_key) { | |
if(encrypt.size() % 8 != 0){ //not a multiple of 8 | |
byte[] padded = new byte[encrypt.length + 8 - (encrypt.length % 8)]; | |
//copy the old array into it |
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 com.google.gson.Gson; | |
import com.google.gson.JsonSyntaxException; | |
import com.android.volley.AuthFailureError; | |
import com.android.volley.NetworkResponse; | |
import com.android.volley.ParseError; | |
import com.android.volley.Request; | |
import com.android.volley.Response; | |
import com.android.volley.Response.ErrorListener; | |
import com.android.volley.Response.Listener; |
OlderNewer