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); |
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]") ); |
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]}) |
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")) |
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
/* | |
* Assuming we have some object with properties and methods | |
*/ | |
var me = { | |
first_name: 'Ahikar', | |
last_name: 'Grilka', | |
race: 'Klingon', | |
email: 'AhikarGrilka@jourrapide.com', | |
occupation: 'Commander of Defence', | |
greet: function(other_person){ |
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
// Create the Global class in your /app folder root package: | |
import play.api.{GlobalSettings, Play} | |
import play.api.Play.current | |
import play.api.mvc._ | |
import scala.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
/** |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.12.+' | |
} | |
} |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.12.+' | |
} | |
} |
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
export ANDROID_HOME=/Applications/AndroidStudio.app/sdk | |
export PATH=$HOME/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH | |
source git-completion.bash | |
# add current git branch to prompt | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="\[\033[00m\]\u@\h\[\033[01;34m\] \W \[\033[31m\]\$(parse_git_branch) \[\033[00m\]$\[\033[00m\] " |
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
http://www.fontspace.com/backpacker/bpdots |