Skip to content

Instantly share code, notes, and snippets.

View flashingpumpkin's full-sized avatar
🏠
Working from home

Alen Mujezinovic flashingpumpkin

🏠
Working from home
View GitHub Profile
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()
}
#!/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
package test.zipper
object TreeZipper extends App {
println("hello")
// exp 2 * 3 + 4 * 6
val _2 = Node("2", Nil)
val _3 = Node("3", Nil)
import scala.xml.{Node, Elem, Group}
/**
* A path to a Node in a Node tree.
*/
sealed trait NodePath {
def depth: Int
}
object NodePath {
(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++;
}
# 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:
#
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
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()
<div style="display: none;">
<form action="." method="post" name="save-user"></form>
</div>
<script type="text/javascript">
$('form[name=save-user]').submit();
</script>
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(){