Skip to content

Instantly share code, notes, and snippets.

import sbt._
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
val proguard = "org.scala-tools.sbt" % "sbt-proguard-plugin" % "0.0.4"
}
import sbt._
class Project(info: ProjectInfo) extends DefaultProject(info) with ProguardProject {
//project name
override val artifactID = "myprogram"
//program entry point
override def mainClass: Option[String] = Some("com.example.MyMainClass")
//proguard
#!/usr/bin/python
#
# Automatically synchronize your workspace with GitHub using the GitHub API.
#
# Prerequisites:
# - Install pip.
# On Ubuntu: sudo apt-get install python-pip
# - Using pip, install github2 Python bindings.
# sudo pip install github2
# - Install curl.
@ymasory
ymasory / GetVersion.scala
Created April 17, 2011 00:25
detect Scala version at runtime
/** Use with a default value, for example:
* runningScalaVersion getOrElse "2.8.0"
*/
lazy val runningScalaVersion = {
val matcher = """version (\d+\.\d+\.\d+).*""".r
util.Properties.versionString match {
case matcher(versionString) => Some(versionString)
case _ => None
}
}
@ymasory
ymasory / gconf.py
Created April 21, 2011 02:03
my gnome customization script
#!/usr/bin/python
# GNOME customization script.
#
# Tested on Ubuntu 10.10, Debian Squeeze, Debian Sid (circa April 2011).
# Run as root.
#
# @author Yuvi Masory
import getpass
@ymasory
ymasory / scala-irc-people.md
Created June 20, 2011 01:05 — forked from SethTisue/scala-irc-people.md
Who's Who on #scala

who's who on #scala

in ascending order of how easy they are to guess

additions/corrections welcome

Very Hard

@ymasory
ymasory / RetroLogger.scala
Created September 16, 2011 05:14 — forked from gseitz/RetroLogger.scala
RetroLogger - Bringing old school log level commands to sbt-0.10.x
/* RetroLogger.scala
*
* A handy sbt-0.10.x plugin that allows you to set the log level like in the
* old days (AKA sbt-0.7.x).
*
* It works by creating aliases of this form:
* "set logLevel := Level.Debug" ====> "debug"
*
* Installation:
* - mkdir -p ~/.sbt/plugins/
trait WithContext {
var ctx = null
def setContext(c:Context): Unit = if (ctx == null) {
ctx = c
} else {
sys.error("already set")
}
def fromContext[T](k:String):T = if (ctx == null) {
sys.error("premature access")
} else {
@ymasory
ymasory / infinite.scala
Created May 12, 2012 16:28
printing an infinite Stream with Scalaz effects
import scalaz._
import Scalaz._
import effects._
object Main extends App {
/* Haskell-style pure main */
def pmain: IO[Unit] = {
val infiniteStream: Stream[String] = Stream continually "hello, world"
infiniteStream.foldr(().pure[IO]) { (el, acc) =>
@ymasory
ymasory / gist:3782247
Created September 25, 2012 14:24
Build Your Website in Scala in a Day

Build Your Website in Scala in a Day

This is a proposed event to be held in Philly. Comments welcome.

  • Theme is "Build Your Website in Scala in a Day". The goal would be for each participant to literally create and deploy a website in a Scala web framework in one day. No spectators; everyone builds a site! It can be your personal homepage, a hobby site, a business site, or anything else, so long as you fully intend to deploy (in alpha condition) at the end of the day.
  • The event would be oriented toward developers who already have a reasonable knowledge of Scala, but have never used it to build a website.
  • The event would be held on a Friday in 6-8 weeks, in Philadelphia. Friday because I want it to be a little more professional and business-oriented than Scalathon. Employers who actually need a website can send employees, for example.
  • It would feature 2 or 3 frameworks (to be determined, based on interest/availability of core developers to attend). There would be maybe 7-10 participants p