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
// 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
[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
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
package code.snippet | |
import net.liftweb._ | |
import http.js._ | |
import http.js.JE._ | |
import http.js.JsCmds._ | |
import http.json._ | |
import util.Helpers._ | |
object KoForm { |
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
package code.model | |
import scala.xml._ | |
import net.liftweb.util._ | |
import net.liftweb.common._ | |
import net.liftweb.http.S | |
import net.liftweb.record._ | |
import net.liftweb.record.field._ | |
import S._ |
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 sbt._ | |
import sbt.Keys._ | |
object MyBuild extends Build { | |
import Dependencies._ | |
import BuildSettings._ | |
lazy val main = Project("root", file(".")) | |
.settings(mainWebSettings: _*) | |
.settings( |
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
There may be times when you want to edit some variables in for example a database connection file, to run an application right from within your GIT repo. Of course you don’t wont those changes to be commited, so you add the file the .gitignore. | |
However adding tracked files to .gitignore won’t work because GIT will still track the changes and commit the file if you use the -a parameter. | |
Fortunately GIT has a very easy solution for this, just run the following command on the file or path you want to ignore the changes of: | |
git update-index --assume-unchanged <file> | |
If you wanna start tracking changes again run the following command: | |
git update-index --no-assume-unchanged <file> | |
You can find more info about this in the git manual. |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
object enumFieldArray extends MongoListField[SomeEntity, Enum](this) { | |
val enum = SomeEnum | |
override def asDBObject: DBObject = { | |
val dbl = new BasicDBList | |
value.foreach { f => dbl.add(f.toString) } | |
dbl | |
} | |
override def setFromDBObject(dbo: DBObject): Box[MyType] = { |