This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait GroupMenu extends SnippetHelpers { | |
def itemHtml: NodeSeq | |
def itemActiveHtml: NodeSeq | |
def outerHtml: NodeSeq | |
def render(in: NodeSeq): NodeSeq = { | |
for { | |
group <- S.attr("group") ?~ "Group not specified" | |
sitemap <- LiftRules.siteMap ?~ "Sitemap is empty" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = ******** | |
email = *********** | |
[alias] | |
au = add -u | |
br = branch | |
ci = commit | |
cia = commit --amend | |
co = checkout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Say you have some case objects like this: | |
package code | |
sealed trait Concept | |
case object Address extends Concept | |
case object City extends Concept | |
// From these you can create an html select list: | |
<select name="concept"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Things to do after a fresh install | |
# Ubuntu 12.04 LTS | |
# Author : Tim Nelson <http://eltimn.com/> | |
# License : Apache 2.0 | |
# update system | |
sudo apt-get update | |
sudo apt-get upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.MathContext | |
import net.liftweb.record.field._ | |
import net.liftweb._ | |
import common._ | |
import json._ | |
import json.ext.{EnumSerializer, JsonBoxSerializer} | |
import mongodb.record._ | |
import mongodb.record.field._ | |
import paypal._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.xml.NodeSeq | |
import net.liftweb._ | |
import common._ | |
import json._ | |
import json.ext.{EnumSerializer, JsonBoxSerializer} | |
import mongodb.JObjectParser | |
import mongodb.record.BsonRecord | |
import mongodb.record.field.MongoFieldFlavor | |
import record.{Field, FieldHelpers, MandatoryTypedField} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Boot extends Loggable { | |
def boot { | |
// set the default htmlProperties | |
LiftRules.htmlProperties.default.set((r: Req) => new XHtmlInHtml5OutProperties(r.userAgent)) | |
// set htmlProperties based on uri | |
LiftRules.earlyInStateful.append(HtmlPropertiesManager.testUri) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.mutable.{HashMap, SynchronizedMap} | |
import scala.xml._ | |
import net.liftweb._ | |
import common._ | |
import http._ | |
import util.Props | |
import util.Helpers._ | |
/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3.1 | |
# This is script that extracts the trees of two commits to temporary | |
# directories and then runs meld on both directories, so you can compare | |
# them using meld's nice recursive browsing interface. | |
# | |
# This is for an answer to this question: | |
# http://stackoverflow.com/questions/2006032/view-differences-of-branches-with-meld | |
from subprocess import call, Popen, PIPE, check_call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.regex._ | |
import scala.xml._ | |
import org.mindrot.jbcrypt.BCrypt | |
import net.liftweb._ | |
import common._ | |
import http.S | |
import http.js._ | |
import json.JsonAST.{JNothing, JNull, JString, JValue} |