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 controllers | |
import org.squeryl.PrimitiveTypeMode._ | |
import org.squeryl.{Session} | |
import play.api._ | |
import play.api.mvc._ | |
import models._ |
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
(use '[clojure.core.match :only [match]]) | |
(defn evaluate [env [sym x y]] | |
(match [sym] | |
['Number] x | |
['Add] (+ (evaluate env x) (evaluate env y)) | |
['Multiply] (* (evaluate env x) (evaluate env y)) | |
['Variable] (env x))) | |
(def environment {"a" 3, "b" 4, "c" 5}) |
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 net.fwbrasil.sReflection | |
object CascadeImplicits { | |
implicit def toYourself[T](value: T): Yourself[T] = new Yourself(value) | |
implicit def toCascade[T](value: T): Cascade[T] = new Cascade(value) | |
class Yourself[T](value: T) { | |
def yourself = value | |
} |
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
import org.robovm.cocoatouch.coregraphics._ | |
import org.robovm.cocoatouch.foundation._ | |
import org.robovm.cocoatouch.uikit._ | |
object Utils { | |
import scala.language.implicitConversions | |
implicit class RichUIControl(control: UIControl) { |
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
sealed trait Result | |
case object X extends Result | |
case object O extends Result | |
case object Tie extends Result | |
object Game { | |
type Player = (Result, Set[Int]) | |
private val emptySet: Set[Int] = Set() | |
private val availableSquares = (1 to 9).toSet |
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
import org.scalatest.BeforeAndAfterAll | |
import org.openqa.selenium.WebDriver | |
import org.openqa.selenium.htmlunit.HtmlUnitDriver | |
import org.scalatest.FlatSpec | |
import play.api.test.TestServer | |
import org.scalatest.Matchers | |
import play.api.test.Helpers | |
import org.scalatest.selenium.WebBrowser | |
import play.api.test.FakeApplication |
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.wausoft.extensions | |
object SafeString { | |
class StrOps(input: String) { | |
private def toOption[A](in: => A) = try { | |
Some(in) | |
} catch { | |
case _: Throwable => None | |
} |
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
#!/usr/bin/env python | |
# Search for names known to Python GObject-Introspection. | |
# All rights waived: https://creativecommons.org/publicdomain/zero/1.0/ | |
from __future__ import print_function | |
import importlib | |
import os.path | |
import sys | |
import re | |
from optparse import OptionParser |
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
// Infinite runner! | |
import "sounds" | |
clear | |
display(5).mode = displayMode.tile | |
td = display(5) | |
td.extent = [150, 10] | |
td.tileSet = file.loadImage("/sys/pics/SimplePlatformTiles.png") | |
td.tileSetTileSize = [64,64] |