This file contains 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 com.quotelibrary.snippet | |
import _root_.net.liftweb.http._ | |
import S._ | |
import SHtml._ | |
import js._ | |
import JsCmds._ | |
import JE._ | |
import _root_.net.liftweb.util._ | |
import Helpers._ |
This file contains 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 com.quotelibrary.snippet | |
import _root_.net.liftweb.http._ | |
import S._ | |
import SHtml._ | |
import js._ | |
import JsCmds._ | |
import JE._ | |
import _root_.net.liftweb.util._ | |
import Helpers._ |
This file contains 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 | |
#/usr/bin/mvn $* | awk '{ print; if($0 ~ ".*Downloading.*") system("/usr/local/bin/growlnotify -n mavenError -t Maven Downloading -m\""$0 "\"") if($0 ~ ".*ERROR.*") system("/usr/local/bin/growlnotify -n mavenError -t Maven Error -m\""$0 "\"") } END { system("/usr/local/bin/growlnotify -n mavenComplete -t Maven -m \"Build Complete\"") }' | |
/usr/bin/mvn $* | awk '{ print; | |
if($0 ~ ".*Downloading.*") | |
system("/usr/local/bin/growlnotify -n mavenError -t Maven Downloading -m\""$0 "\"") | |
if($0 ~ ".*ERROR.*") system("/usr/local/bin/growlnotify -n mavenError -t Maven Error -m\""$0 "\"") } | |
END { | |
system("/usr/local/bin/growlnotify -n mavenComplete -t Maven -m \"Build Complete\"") }' |
This file contains 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
Vim replace commands to fix goofy quotes in Lyx | |
:%s/\\begin_inset Quotes eld\n\\end_inset/"/g | |
:%s/\\begin_inset Quotes erd\n\\end_inset/"/g |
This file contains 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
CmdUtils.CreateCommand({ | |
name: "lift", | |
homepage: "http://praytothemachine.com/evil/code/ubiquity/lift.js", | |
description: "Search Lift's API", | |
help: "Simply type lift and the classname and it will do a google search for API documentation on that class", | |
icon: "http://www.scala-lang.org/sites/default/files/favicon.gif", | |
takes: {"class name": noun_arb_text}, | |
preview: function(pblock, directObject) { | |
var searchTerm = directObject.text; | |
var pTemplate = "Searches Lift Docs for <b>${query}</b>"; |
This file contains 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
// I never remember.... | |
shell> mysqldump db_name > backup-file.sql | |
shell> mysql db_name < backup-file.sql |
This file contains 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
# I made a change to the PS1, I prefer my dirpath on a line above the prompt, | |
# so the prompt does not wind up at the right edge in deep trees. | |
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" |
This file contains 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
/*From: http://www.nabble.com/More-elegant-way-of-reading-HTML-from-a-URL-than-this--to21576710.html | |
*/ | |
class URLLineReader(url: String) { | |
val reader = new java.io.BufferedReader(new java.io.InputStreamReader(new java.net.URL(url).openStream(), "US-ASCII")); | |
def foldLeft[T](init: T)(f: (T, String) => T): T = reader.readLine match { | |
case null => init | |
case line => foldLeft(f(init, line))(f) | |
} | |
} |
This file contains 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
I forget this a lot: | |
http://css.maxdesign.com.au/listamatic/horizontal01.htm | |
HTML | |
<div id="navcontainer"> | |
<ul id="navlist"> | |
<li id="active"><a href="#" id="current">Item one</a></li> | |
<li><a href="#">Item two</a></li> | |
<li><a href="#">Item three</a></li> | |
<li><a href="#">Item four</a></li> |
This file contains 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 MyPayPalIPN extends PayPalIPN { | |
def actions = { | |
case (action, info, _) => { | |
val payAmt: Long = info.paymentGross match { | |
case Full(gross) => gross.roboSplit("\\.") match { | |
case whole :: fraction => println("split case");toLong(whole) * 100 + toLong(fraction) | |
case _ => println("non-split case"); toLong(info.paymentGross) | |
} | |
case _ => 0 | |
} |
OlderNewer