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 ApplicationBuild extends Build { | |
val appName = "society20-app" | |
val appVersion = "1.0-SNAPSHOT" | |
val appDependencies = Seq( | |
"commons-codec" % "commons-codec" % "1.6") | |
val main = PlayProject( appName, appVersion, appDependencies, mainLang = SCALA ).settings() | |
} |
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 ruby | |
require "rubygems" | |
require "spidr" | |
require "open-uri" | |
=begin | |
= CSS snowball | |
Rolls through your site, picking up style attributes and making you | |
a new stylesheet. Once you've got your stylesheet, run it through |
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 test.zipper | |
object TreeZipper extends App { | |
println("hello") | |
// exp 2 * 3 + 4 * 6 | |
val _2 = Node("2", Nil) | |
val _3 = Node("3", Nil) |
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 scala.xml.{Node, Elem, Group} | |
/** | |
* A path to a Node in a Node tree. | |
*/ | |
sealed trait NodePath { | |
def depth: Int | |
} | |
object NodePath { |
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
(function() { | |
// Do not use this library. This is just a fun example to prove a | |
// point. | |
var Bloop = window.Bloop = {}; | |
var mountId = 0; | |
function newMountId() { | |
return mountId++; | |
} |
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
# maybe.py - a Pythonic implementation of the Maybe monad | |
# Copyright (C) 2014. Senko Rasic <senko.rasic@goodcode.io> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# |
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
abstract class Product | |
abstract class PizzaBuilder { | |
var dough: String | |
var sauce: String | |
var topping: String | |
def withDough(dough: String): PizzaBuilder | |
def withSauce(sauce: String): PizzaBuilder | |
def withTopping(topping: String): PizzaBuilder |
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
class Try(object): | |
""" | |
Encapsulate an operation potentially throwing an error. A try | |
instance is `True` if no error was thrown, it's `False` if an | |
error occured. | |
""" | |
def __init__(self, fn): | |
self.fn = fn | |
self() |
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
<div style="display: none;"> | |
<form action="." method="post" name="save-user"></form> | |
</div> | |
<script type="text/javascript"> | |
$('form[name=save-user]').submit(); | |
</script> |
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
function _bash_git_status(){ | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo " *" | |
} | |
function _bash_git(){ | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ ~\1$(_bash_git_status)/' | |
} | |
function _virtual_env_name(){ | |
[[ $(basename $VIRTUAL_ENV 2>/dev/null) ]] && echo "($(basename $VIRTUAL_ENV))" | |
} | |
function prompt(){ |
OlderNewer