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 lzw { | |
trait Appendable[T] { | |
def append(value: T) | |
} | |
import scala.collection.generic._ | |
case class GrowingAppendable[T](growable: Growable[T]) extends Appendable[T] { | |
def append(value: T) { | |
growable += 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
object =^ { def ^= = "meow" } | |
// defined module $eq$up | |
=^.^= | |
// res10: java.lang.String = meow |
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 pe.gob.mef.banco_proyectos.commons.util; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.Locale; | |
import java.util.PropertyResourceBundle; | |
import java.util.ResourceBundle; |
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
[ui] | |
username = Hector Miuler Malpica Gallegos <miuler@gmail.com> | |
[extensions] | |
churn = | |
convert = | |
rebase = | |
purge = | |
progress = | |
graphlog = |
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 | |
import fileinput | |
import argparse | |
from operator import itemgetter | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int) | |
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+') | |
args = parser.parse_args() |
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 smtpd | |
import asyncore | |
class FakeSMTPServer(smtpd.SMTPServer): | |
__version__ = 'TEST EMAIL SERVER' | |
def process_message(self, peer, mailfrom, rcpttos, data): | |
print 'Receiving message from:', peer | |
print 'Message addressed from:', mailfrom | |
print 'Message addressed to :', rcpttos |
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
################################################################################### | |
# /etc/init/play.conf | |
# Upstart script for a play application that binds to an unprivileged user. | |
# put this into a file like /etc/init/play.conf | |
# | |
# This could be the foundation for pushing play apps to the server using something like git-deploy | |
# By calling service play stop in the restart command and play-start in the restart command. | |
# | |
# Usage: |
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
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0") | |
resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" | |
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.2.0-SNAPSHOT") |
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
The Objective | |
This language experiment was designed to show how parametric polymorphism and type classes are implemented in | |
different languages. The implementation languages where chosen out of personal preference. I am well aware it's not | |
complete and would love for you to help me with that. If you don't see your favorite language please add it as | |
a comment. I am also not an expert in all of these languages but did try to make them as idiomatic as possible. | |
If you believe there is a better solution please leave a comment with the implementation. | |
Personal Takeaways: | |
* ML based languages provide very terse and readable code, when compared to C based syntax. |
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
public class OSValidator { | |
public static void main(String[] args) { | |
if (isWindows()) { | |
System.out.println("This is Windows"); | |
} else if (isMac()) { | |
System.out.println("This is Mac"); | |
} else if (isUnix()) { | |
System.out.println("This is Unix or Linux"); | |
} else if (isSolaris()) { |