Skip to content

Instantly share code, notes, and snippets.

@lamikae
lamikae / jhw-assets.md
Created February 5, 2012 12:28
Jasmine headless testing on Rails 3 asset pipeline

Jasmine headless testing on Rails 3 asset pipeline

  • assets and specs can be CoffeeScript
  • 3rd party JS can be placed to vendor/assets/javascripts or vendor gems
  • detects gem-vendored JS via application.js require
  • uses jasmine-headless-webkit to run the suite outside the browser
    • this requires Qt4.7 installation
@lamikae
lamikae / gist:629007
Created October 15, 2010 21:44
get or create user
# -*- coding: utf-8 -*-
import time
from django.db import models, connection
from myapp.models import OraAbbOy1001
id = # comes somewhere
try:
user = OraAbbOy1001.objects.get(id=id)
except OraAbbOy1001.DoesNotExist:
class CoreService(Thread):
"""Every message in the CoreService goes through AMQP.
The CoreService initiates an Exchange, when a
* JSON request is received from remote host by RPC
* SOAP request is received from remote host by WSDL
These are internal methods that are executed in daemon mode.
The CoreService API has public methods to
* send JSON request to remote host by RPC