https://gist.github.com/1341606
pip install Django
from django.conf import settings | |
from django.utils.translation import string_concat, ugettext_lazy | |
from django.utils.html import strip_tags | |
from haystack import indexes, site | |
from cms.models.managers import PageManager | |
from cms.models.pagemodel import Page | |
from cms.models.pluginmodel import CMSPlugin |
Choose a ticket class: <select id="tickets"></select> | |
<p id="ticketOutput"></p> | |
<script id="ticketTemplate" type="text/x-jquery-tmpl"> | |
{{if chosenTicket}} | |
You have chosen <b>${ chosenTicket().name }</b> | |
($${ chosenTicket().price }) | |
<button data-bind="click: resetTicket">Clear</button> | |
{{/if}} |
https://gist.github.com/1341606
pip install Django
class SlidingWindowMap(keys: Set[String], maxCount: Int, periodMs: Int) { | |
val times = collection.mutable.Map(keys.map(k => (k, Vector[Long]())).toList:_*) | |
def nextKey: Option[String] = { | |
val now = System.currentTimeMillis | |
this.synchronized { | |
val key = times.find(_._2.dropWhile(_ < now - periodMs).size < maxCount).map(_._1) | |
key.foreach { k => times(k) = times(k).dropWhile(_ < now - periodMs) :+ now } | |
key | |
} | |
} |
augroup sourcesession | |
autocmd! | |
autocmd VimEnter * nested | |
\ if !argc() && empty(v:this_session) && filereadable('Session.vim') | | |
\ source Session.vim | | |
\ endif | |
augroup END |
<!-- Mocha test output goes here. --> | |
<div id="mocha"></div> | |
<!-- Handlebars templates for our application. --> | |
<script type="text/x-handlebars"> | |
<h1>Testing Ember.js with Mocha</h1> | |
{{outlet}} | |
</script> | |
<script type="text/x-handlebars" data-template-name="index"> |
Play Framework vs. the relative messiness of Yesod/Snap/Happstack/Scotty/raw WAI. Clojure has a similar (to Haskell's) story here. I'm understating it here, but this is pretty big. Most web applications are not special snowflakes, a framework to wrap-up common-case nonsense concisely is very valuable. Micro-framework stacks like using WAI directly or Scotty are good to have, but insufficient.
Specialized NLP libraries (in Java, at present) such as for medical lexicons. Might be replicable by being layered on top of existing Haskell NLP libs, but doesn't yet exist to my knowledge. Hardening up libraries like this usually takes a lot of time.
Slick is nicer and easier to get started with than Persistent. Partly due to documentation, partly because Slick isn't silly and embraces relational databases directly, partly because Persistent is just kind of hairy. Supporting MongoDB isn't a plus, it's a minus. Compromises the API anyway.
A migrations library of pretty much any sort at all.
Scala/xml equivalent i
import Ember from "ember"; | |
var get = Ember.get; | |
var copy = Ember.copy; | |
var removeObserver = Ember.removeObserver; | |
var addObserver = Ember.addObserver; | |
var DocumentTitleMixin = Ember.Mixin.create({ | |
titleTokensDidChange: function () { |