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 org.scalatra | |
import socketio.{SocketIOServlet} | |
class SocketIOExample extends SocketIOServlet { | |
// overriden because otherwise you need a trailing slash for the root url | |
// prefer the freedom with or without root. | |
override def requestPath = { | |
val p = (Option(request.getPathInfo) getOrElse "").trim |
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
#!/bin/bash | |
#Set Defaults | |
requests=${requests:=10} | |
threads=${threads:=1} | |
url=${url:=http://testserver/} | |
while getopts "r:t:u:h" Option | |
do | |
case $Option in |
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
$(document).ready(function(){ | |
$.each($.browser, function(i, val) { | |
if(i=="mozilla") | |
// alert("Ikenna Do stuff for firefox 3 Now now") | |
$('#header').before('<br/><br/>'); | |
}); | |
$("#loading").ajaxStart(function(){ | |
$(this).append("<p><img src='/images/ajax-loader-2.gif' border='0' align='center' /></p>"); |
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
object AuthenticatedSession extends Loggable { | |
def logIn(credentialsOption: Option[Credentials]): Twitter = { | |
val (tw, credentials) = credentialsOption match { | |
case Some(cr) => | |
(createTwitter(Some(cr)), cr) | |
case None => | |
val requestToken = tw.getOAuthRequestToken | |
DesktopUtil.browse(requestToken.getAuthorizationURL) | |
(createTwitter(None), Dialog.showInput(null, "Enter the PIN from the Twitter authorization page in your browser", | |
"Enter PIN", Dialog.Message.Question, null, List[String](), "") match { |
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 org.bowlerframework.view.squery.component.ValidationFeedbackPanel._ | |
import org.bowlerframework.view.squery.Component | |
import org.bowlerframework.RequestScope | |
class NewWidgetForm extends Component{ | |
val request = RequestScope.request | |
$("#errorPanel").contents = showErrorMessages | |
request.getSession.getValidatedModel match{ |
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.mojolly.backchat | |
package web | |
class MySocketIOClient extends Client { | |
def receive = { | |
case Connected => { | |
} | |
case Message(msg) => { | |
//handlePlainTextMessage |
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.mojolly.backchat | |
package web | |
import org.scalatra.ScalatraServlet | |
import akka.actor.{Scheduler, Actor} | |
import javax.servlet.http.{HttpServletResponse, HttpServletRequest} | |
import org.atmosphere.cpr.BroadcastFilter.BroadcastAction | |
import org.atmosphere.cpr._ | |
import org.atmosphere.util.XSSHtmlFilter | |
import collection.JavaConversions._ |
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 RUBYOPT="rubygems" | |
rvm_install_on_use_flag=1 | |
if [ -z $(rvm gemset list | grep virtmachines) 2> /dev/null ]; then | |
rvm ruby-1.8.7 | |
rvm gemset create virtmachines | |
fi | |
rvm ruby-1.8.7@virtmachines |
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 sbt._ | |
import Keys._ | |
import org.sbtidea._ | |
import SbtIdeaPlugin._ | |
import Scope.{GlobalScope, ThisScope} | |
object BuildSettings { | |
val buildOrganization = "com.mojolly.backchat" | |
val buildScalaVersion = "2.9.0-1" | |
val buildVersion = "0.8.1-SNAPSHOT" |
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 this to your spec_helper.rb | |
RSpec.configure do |config| | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.around(:each, :vcr) do |example| | |
name = example.metadata[:full_description].downcase.gsub(/\W+/, "_").split("_", 2).join("/") | |
VCR.use_cassette(name, :record => :new_episodes) do | |
example.call | |
end | |
end | |
end |
OlderNewer