Skip to content

Instantly share code, notes, and snippets.

View ikennaokpala's full-sized avatar
🎯
Focusing

Ikenna N. Okpala ikennaokpala

🎯
Focusing
View GitHub Profile
package com.mojolly.backchat
package web
class MySocketIOClient extends Client {
def receive = {
case Connected => {
}
case Message(msg) => {
//handlePlainTextMessage
@wfaler
wfaler / NewWidgetForm.scala
Created April 3, 2011 17:52
NewWidgetForm.scala
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{
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 {
@ikennaokpala
ikennaokpala / login.js
Created February 13, 2011 14:14
Login status switch with Jquery Ajax
$(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>");
@bruntonspall
bruntonspall / runtest.sh
Created January 20, 2011 15:43
How I run perf tests repeatably with records of what I did
#!/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
@casualjim
casualjim / gist:779445
Created January 14, 2011 10:19
Scalatra Socket.IO example
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