View enable-volley-verbose-logging
This file contains 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
# (42f63b0de7318fe1 is a device id) | |
adb -s 42f63b0de7318fe1 shell setprop log.tag.Volley VERBOSE |
View DecoratedRequestQueue.java
This file contains 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.vuzz.snapdish.test.functional; | |
import android.os.Handler; | |
import com.android.volley.Cache; | |
import com.android.volley.Request; | |
import com.android.volley.RequestQueue; | |
import com.google.android.apps.common.testing.ui.espresso.contrib.CountingIdlingResource; | |
/** | |
* A dummy request queue which enables us to use the Volley Library properly with Espresso. |
View regex-japanese.txt
This file contains 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
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
([一-龯]) | |
Regex for matching Hirgana or Katakana | |
([ぁ-んァ-ン]) | |
Regex for matching Non-Hirgana or Non-Katakana | |
([^ぁ-んァ-ン]) | |
Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
View CollectionUtils.java
This file contains 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 es.cloudey.pagespeed.util; | |
import java.util.HashMap; | |
import java.util.Map; | |
import android.os.Bundle; | |
import android.os.Parcelable; | |
public class CollectionUtils { | |
public static Bundle toBundle(Map<String, ? extends Parcelable> input) { |
View analytics.coffee
This file contains 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
# add the tracking code normally to your layout; then include this in every page | |
$(document).on 'page:change', -> | |
if window.ga? | |
ga('send', 'pageview'); | |
else if window._gaq? | |
_gaq.push(['_trackPageview']) | |
else if window.pageTracker? | |
pageTracker._trackPageview() |
View init_crittercism.java
This file contains 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
/*###################### | |
* Crittercism | |
* crittercism.com | |
######################*/ | |
JSONObject crittercismConfig = new JSONObject(); | |
JSONObject crittermeta = new JSONObject(); | |
try { | |
crittermeta.put("screen_name", "" + screen_name); | |
crittermeta.put("user_id", "" + user_id); |
View findByXPath.js
This file contains 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
function getElementByXpath(path) { | |
return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; | |
} | |
console.log( getElementByXpath("//html[1]/body[1]/div[1]") ); |
View CustomActiveRecordDsl.scala
This file contains 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
val jodaDateTimeConverter = new FormConverter[DateTime] { | |
override def serialize(v: Any): String = | |
new DateTime(v).toString(ISODateTimeFormat.dateHourMinuteSecond) | |
override def deserialize(s: String): DateTime = | |
new DateTime(s.toLong) | |
} | |
FormConverter.register(classOf[DateTime], jodaDateTimeConverter) | |
ClassInfo.factories.register(classOf[DateTime], {() => DateTime.now.asInstanceOf[AnyRef]}) |
View ARAutoRollback.scala
This file contains 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.github.aselab.activerecord.{PlayConfig, ActiveRecordTables} | |
import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} | |
import play.api.Play | |
import play.api.test.FakeApplication | |
trait ActiveRecordAutoRollback extends BeforeAndAfterEach with BeforeAndAfterAll { | |
self: ApiBaseSpec => | |
def schema: Seq[ActiveRecordTables] = Seq(ActiveRecordTables.find("models.Tables")) |