Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
package tictactoe | |
import scala.annotation.tailrec | |
// model | |
trait Square | |
case object X extends Square { | |
override def toString: String = "X" | |
} |
object CracklePop { | |
def main(args: Array[String]): Unit = { | |
(1 to 100).collect { | |
case number if (number % 5 == 0) && (number % 3 == 0) => println("CracklePop") | |
case number if number % 5 == 0 => println("Pop") | |
case number if number % 3 == 0 => println("Crackle") | |
case number => println(number) | |
} | |
} | |
} |
/** | |
* [WIP] | |
* | |
* The goal is to recursively convert a genericRecord to have lower case field names. | |
*/ | |
import org.apache.avro.{Schema, SchemaBuilder} | |
import scala.collection.JavaConverters._ |
def intersect(first: List[Int], second: List[Int]): Seq[Int] = { | |
val result = for { | |
i <- first | |
j <- second | |
if i == j | |
} yield i | |
result.toSet.toSeq | |
} |
class Connection { | |
String urlPath | |
private String username = project.properties.username | |
private String password = project.properties.password | |
private String basicAuth = "$username:$password".bytes.encodeBase64().toString() | |
URL url = urlPath.toURL(); | |
InputStream getStream() { | |
URLConnection connection = url.openConnection(); |
/var/log/transmit.log { | |
su root pi | |
copytruncate | |
compress | |
daily | |
rotate 7 | |
missingok | |
notifempty | |
} |
find . -mtime +n -print -exec gzip {} \; |
# Put this in your ~/.gitconfig or ~/.config/git/config | |
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName> | |
[user] | |
name = Your Full Name | |
email = your@email.tld | |
[color] | |
# Enable colors in color-supporting terminals | |
ui = auto | |
[alias] | |
st = status |