Skip to content

Instantly share code, notes, and snippets.

View reyjexter's full-sized avatar

Rey Bumalay reyjexter

View GitHub Profile
def submitLogin = Action.async { implicit request =>
val futureForm = scala.concurrent.Future { loginForm.bindFromRequest }
futureForm.map(form => {
form.fold(
formWithErrors => BadRequest(html.auth.login(formWithErrors)),
resultForm => {
resultForm match {
case (username, password) => {
val futureUser = User.findByUsername(username)
def submitLogin = Action.async { implicit request =>
val futureForm = scala.concurrent.Future { loginForm.bindFromRequest }
futureForm.map(form => {
form.fold(
formWithErrors => BadRequest(html.auth.login(formWithErrors)),
resultForm => {
resultForm match {
case (username, password) => {
def submitLogin = Action { implicit request =>
val futureForm = scala.concurrent.Future { loginForm.bindFromRequest }
Async {
futureForm.map(form => {
form.fold(
formWithErrors => BadRequest(html.auth.login(formWithErrors)),
resultForm => {
resultForm match {
case (username, password) => {
/**
* Wait for new notification socket
*/
def waitForNotification = WebSocket.using[JsValue] { request =>
val iteratee = Promise[Iteratee[JsValue, Unit]]()
val enumerator = Concurrent.unicast[JsValue](onStart = { clientChannel =>
iteratee.success(Iteratee.foreach[JsValue] {
json => {
Logger.debug("== Enumerator called ==")
var tabGroup = Titanium.UI.createTabGroup({id:'tabGroup1'});
var win1 = Titanium.UI.createWindow({backgroundColor: '#ffffff'});
win1.addEventListener('android:back', function() {
alert("android:back event firing from win1");
});
var tab1 = Titanium.UI.createTab({
id:'tab1',
title: "Tab 1",
window:win1
var win1 = Titanium.UI.createWindow({
title : 'Window',
left : 0,
top : 0,
backgroundColor : '#FFF'
});
win1.open();
var win = Ti.UI.createWindow({
backgroundColor: '#000000'
});
var row = Ti.UI.createTableViewRow();
var scrollView = Ti.UI.createScrollView({
borderRadius: 3,
borderColor:'#AAA'
});
# full text
mapping do
indexes :id, :index => :not_analyzed
indexes :name, :type => 'string', :boost => 100
indexes :name_sorted, :store => 'no', :index => :not_analyzed
indexes :description, :analyzer => 'snowball'
indexes :enabled, :type => 'boolean'
indexes :total_shows, :type => 'integer'
indexes :shows
indexes :created_at, :type => 'date'