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
/* | |
* jQuery placeholder Plugin | |
* version: 0.1 | |
* @requires: jQuery v1.4.1 or later, Modernizr, and jquery livequery plugin | |
* | |
* http://docs.jquery.com/Plugins/livequery | |
* | |
* To use: When you write your input tags, include a title and placeholder attribute as | |
* well as a placeholder class. Also include styling for the hasPlaceholder class. | |
* |
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
/* | |
* jQuery placeholder Plugin | |
* version: 0.1 | |
* @requires: jQuery v1.4.1 or later, Modernizr, and jquery livequery plugin | |
* | |
* http://docs.jquery.com/Plugins/livequery | |
* | |
* To use: When you write your input tags, include a title and placeholder attribute as | |
* well as a placeholder class. Also include styling for the hasPlaceholder class. | |
* |
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.lang.reflect.Array; | |
import java.lang.reflect.Field; | |
import java.math.BigDecimal; | |
import java.util.Arrays; | |
import java.util.List; | |
public class Dumper { | |
private static final Class[] printtableClasses = new Class[]{ | |
String.class, Integer.class, Float.class, Double.class, | |
BigDecimal.class, Character.class, Byte.class, |
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 MyJobRunner extends Job<List<Something>> { | |
// ... | |
public List<Something> doJobWithResult() throws Exception { | |
// some preparation logic | |
List<List<Something>> = await(F.Promise.waitAll(firstJob.now(), secondJob.now(), ...)); | |
// some merging logic... | |
return ...; | |
} | |
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
sub js_encode { | |
my $text = shift; | |
my @js_entities = ("\\", "\\\\", '&', '\&', '"', '\"', '<', '\<', '>', '\>', "'", "\'"); | |
# This was what was there before: | |
#my @js_entities = ('&', '\&', '"', '\"', '<', '\<', '>', '\>', "'", "\'"); | |
my ($char, $js_char); | |
for (my $i = 0; $i < scalar @js_entities; $i = $i + 2) { | |
$text =~ s/$js_entities[$i]/$js_entities[$i+1]/g; | |
} | |
return $text; |
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
requireLogin = (method) -> | |
(req, res) -> | |
if loggedIn | |
method(req, res) | |
else | |
# blargh! | |
class MyHandler | |
getUser: requireLogin (req, res) -> |
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
name := "MyProject" | |
version := "0.1" | |
scalaVersion := "2.9.1" | |
scalaHome := Some(file("/opt/scala")) | |
scalaSource in Compile <<= baseDirectory(_ / "project") |
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
./project | |
./project/Simulator.scala | |
./.idea_modules | |
./.idea_modules/default-309e8b.iml | |
./.idea_modules/project.iml | |
./run.sh | |
./.history | |
./.idea | |
./build.sbt |
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
[info] Set current project to default-5f8541 (in build file:/home/axiak/.sbt/plugins/) | |
[info] Compiling 2 Scala sources to /home/axiak/.../project/target/scala_2.8.1/classes... | |
[error] /home/axiak/.../project/Build.scala:13: not found: value ShellPrompt | |
[error] shellPrompt := ShellPrompt.buildShellPrompt | |
[error] ^ | |
[error] /home/axiak/.../project/Simulator.scala:26: not found: type App | |
[error] object Simulator extends App { | |
[error] ^ | |
[error] /home/axiak/.../Simulator.scala:27: not found: value args | |
[error] if (args.isEmpty) { |
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
new Iterator[DayRecord] { | |
var numRecords = 0 | |
var nextRecord = actualNext() | |
def next() = nextRecord match { | |
case Some(x) => { | |
nextRecord = actualNext() | |
x | |
} | |
case _ => throw new NoSuchElementException() |