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
| var page = <html/>; | |
| page.head.title = "Example page"; | |
| page.body.p = "Hello"; | |
| console.log(page) => | |
| <html> | |
| <head> | |
| <title>Example page</title> | |
| </head> | |
| <body> | |
| <p>Hello</p> |
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 Maybeable[T](item:T) { | |
| def maybe[V](pf:PartialFunction[T,V=>V]):V=>V = | |
| if (pf.isDefinedAt(item)) | |
| pf(item) | |
| else | |
| identity _ | |
| } | |
| implicit def toMaybe[T](item:T):Maybeable[T] = new Maybeable(item) |
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
| # Contributor: [Vitaliy Berdinskikh](mailto:[email protected]) aka UR6LAD | |
| # Contributor: Leif Warner <[email protected]> | |
| _timestamp=v20111024 | |
| pkgname=jetty | |
| pkgver=8.0.4 | |
| pkgrel=1 | |
| pkgdesc="A full-fledged production-grade lightweight Java Servlet Container" | |
| arch=('i686' 'x86_64') | |
| url="http://jetty.codehaus.org/jetty/" | |
| license=('Apache' 'EPL') |
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
| source 'http://rubygems.org' | |
| gem 'rails', '3.1.3' | |
| gem 'activerecord-jdbc-adapter' | |
| gem 'awesome_print' | |
| gem 'jruby-openssl' | |
| gem 'json' | |
| gem 'trinidad' |
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
| include_class "com.example.Foo" | |
| Java::JavaLang::ExceptionInInitializerError: | |
| from sun.misc.Unsafe.ensureClassInitialized(Native Method) | |
| from sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43) | |
| from sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:140) | |
| from java.lang.reflect.Field.acquireFieldAccessor(Field.java:949) | |
| from java.lang.reflect.Field.getFieldAccessor(Field.java:930) | |
| from java.lang.reflect.Field.get(Field.java:372) | |
| from org.jruby.javasupport.JavaClass.handleScalaSingletons(JavaClass.java:138) |
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
| \documentclass{article} | |
| \title{Hermeneutics of Zygohistomorphic Prepomorhpisms - A Handyman's Guide} | |
| \author{Leif Warner} | |
| \begin{document} | |
| \maketitle | |
| \begin{enumerate} | |
| \item We can observe that as the zygote asymptomatically approaches the monadic range bounds of Cimmerian endofunctors, the energy levels decrease in a contrainversewise proportion. | |
| \item Vegetation ensues. | |
| \item As Pythagoras famously elided, $ a^2 + b^2 = c^2 $. |
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.Hashtable | |
| import javax.naming._ | |
| import javax.naming.spi._ | |
| import org.postgresql.ds.PGPoolingDataSource | |
| object FakeJndiFactory { | |
| def install() { | |
| System setProperty (Context.INITIAL_CONTEXT_FACTORY , classOf[FakeJndiFactory].getName) | |
| } |
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
| require 'awesome_print' | |
| class CacheWrapper | |
| def initialize(c) | |
| @cache = c | |
| end | |
| def method_missing(meth, *args) | |
| ap meth | |
| ap args | |
| @cache.send(meth, *args) |
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
| // sourceList from CL re-written how it is in haskell-conduit now. | |
| def sourceList[F[_], A](l: => Stream[A])(implicit M: Monad[F]): Source[F, A] = l match { | |
| case Stream.Empty => Closed[F, A] | |
| case x #:: xs => Open(sourceHandle(xs), M.point(()), x) | |
| } | |
| // sans IO monad: | |
| def sourceHandle(h: InputStream): Source[Id, Array[Byte]] = { | |
| val arrayBuf = new Array[Byte](4096) | |
| val r = h.read(arrayBuf) |
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 org.eclipse.jgit.storage.file.FileRepositoryBuilder | |
| import org.eclipse.jgit.api.Git | |
| settings = defaultSettings ++ | |
| Seq( | |
| resourceGenerators in Compile <+= (baseDirectory, resourceManaged, streams) map gitProps | |
| ) | |
| def gitProps(base:File, resources:File, s: TaskStreams) = { | |
| val repo = (new FileRepositoryBuilder).findGitDir.build |