Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
Consumer key: CjulERsDeqhhjSme66ECg
| import sys | |
| import os | |
| import argparse | |
| import gzip | |
| import requests | |
| try: | |
| from lxml import etree | |
| except ImportError: |
| //query builder | |
| var q = new (function() { | |
| this.has = function(key, exists) { | |
| if (typeof exists === 'undefined') { | |
| //default, query for documents that has they key. | |
| exists = true; | |
| } | |
| var query = {}; | |
| query[key] = {$exists: exists}; |
| #!/bin/bash | |
| if (( $# < 2 )) | |
| then | |
| echo "Usage: <watchdir> <targethost:port/dir> [username:password]" | |
| echo "example, $0 myapp localhost:8080/apps" | |
| exit 1 | |
| fi | |
| watchdir="$1" |
Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
Consumer key: CjulERsDeqhhjSme66ECg
| from django import forms | |
| from django.db import models | |
| class Menu(models.Model): | |
| header = models.CharField(max_length=64) | |
| price = models.DecimalField(null=True, max_digits=6, decimal_places=2) | |
| parent = models.ForeignKey('Menu', null=True) | |
| class MenuForm(forms.ModelForm): | |
| class Meta: |
| <qu1j0t3> hm, typesafe and others hiring http://functionaljobs.com/jobs/search/?q=scala | |
| <saml> http://mandubian.com/2013/02/21/play-json-stand-alone/ | |
| <saml> wtf is that website i can't even highlight code snippet | |
| <aloiscochard> saml: this is because it's volatile code | |
| <qu1j0t3> aloiscochard: nothing a good heavy bucket can't fix | |
| <aloiscochard> qu1j0t3: bucket-pasting is indeed the best approach here | |
| <saml> play-json can't deserialize either | |
| <saml> given model: https://github.com/saml/salat-trait-test/blob/master/src/main/scala/model/Model.scala can't deserialize simple json https://github.com/saml/salat-trait-test/blob/master/src/main/scala/app/SalatTraitTest.scala | |
| <aloiscochard> this is not simple saml , there is polymorphism | |
| <aloiscochard> saml: lift-json handle that |
| 6583 15/Mar/2013:17:36:28 -0400 ~ 15/Mar/2013:17:36:35 -0400 GET /bin/services |
| object MongoDBUtils { | |
| private def getAsRec[T: Manifest](dbo: MongoDBObject, keys: List[String]): Option[T] = keys match { | |
| case Nil => None | |
| case key :: Nil => dbo.getAs[T](key) | |
| case key :: rest => dbo.getAs[DBObject](key).flatMap(doc => getAsRec[T](doc, rest)) | |
| } | |
| def getAs[T:Manifest](dbo: MongoDBObject, key: String): Option[T] = getAsRec[T](dbo, key.split('.').toList) | |
| } |
| case class MenuItemPortion(title: String, price: String) | |
| object MenuItemPortion extends Convertable[MenuItemPortion] { | |
| override def readFrom(dbo: MongoDBObject): Option[MenuItemPortion] = { | |
| val title: Option[String] = dbo.getAs[String]("title") | |
| val price: Option[String]= dbo.getAs[String]("price") | |
| if (title.isEmpty && price.isEmpty) None | |
| else Some(MenuItemPortion(title.getOrElse(""), price.getOrElse(""))) | |
| } | |
| } |