Skip to content

Instantly share code, notes, and snippets.

~/src/leema$ cat T/rgb.lma
struct Rgb
.red: Int
.green: Int
.blue: Int
--
func main() ->
let c := Rgb(10, 20, 30)
@mdg
mdg / fizzbuzz.diff
Created July 28, 2016 17:54
fizzbuzz with new block syntax in leema
diff --git a/T/fizzbuzz.lma b/T/fizzbuzz.lma
index beb36ad..086dd3c 100644
--- a/T/fizzbuzz.lma
+++ b/T/fizzbuzz.lma
@@ -1,25 +1,19 @@
-func fizzbuzz(x, max): Void {
+func fizzbuzz(x, max): Void ->
let xm30 = (x mod 3) = 0
let xm50 = (x mod 5) = 0
@mdg
mdg / token-ids.diff
Last active December 22, 2015 06:11
The different of the output for the example parser in lemon-diff given the changes in pull request #3
diff --git a/origin.rs b/token-ids.rs
index 736580d..b849a41 100644
--- a/origin.rs
+++ b/token-ids.rs
@@ -48,23 +48,40 @@ const YYERRORSYMBOL: i32 = 0;
pub enum Token {
EOI, //0
VALUE( i32 ), //1
PLUS, //2
MINUS, //3
@mdg
mdg / README.md
Last active August 29, 2015 14:10
Penn State Technical Conference

Penn State Technical Conference

A technical conference by and for Penn State Alumni.

Lanyrd Page

When/Where

April 17, 2015 - Friday before the [Blue-White Game]

@mdg
mdg / README
Last active August 29, 2015 14:01
Keyur's patches for Etsy API Concurrency
Here's the source RPM we built on:
http://vault.centos.org/6.5/os/Source/SPackages/curl-7.19.7-37.el6_4.src.rpm
The PHP release we applied the patch on is 5.4.26:
http://us1.php.net/get/php-5.4.26.tar.gz/from/a/mirror
@mdg
mdg / animals.cpp
Last active December 20, 2015 15:09
OO Type Hierarchy
class Animal
{
public:
std::string name;
virtual ~Animal() {}
};
class Dog : public Animal
{
public:
@mdg
mdg / factorial.code
Last active December 14, 2015 13:48
Pattern matching factorial function written in my very own programming language.
factorial :=
?(1) => 1
?(0) => 0
?(n) => n * factorial(n-1)
main() => write(@stdout, msg) where
result <- factorial(5)
msg <- "factorial(5) is $result\n"
@mdg
mdg / gist:916685
Created April 12, 2011 23:37
rpm -qa |grep -E "(jpeg|tiff|ghost|png|lcms|wmf)" | sort
$ rpm -qa |grep -E "(jpeg|tiff|ghost|png|lcms|wmf)" | sort
lcms-1.18-0.1.beta1.el5_3.2
lcms-1.18-0.1.beta1.el5_3.2
libjpeg-6b-37
libjpeg-6b-37
libjpeg-devel-6b-37
libjpeg-devel-6b-37
libpng-1.2.10-7.1.el5_5.3
libpng-1.2.10-7.1.el5_5.3
libtiff-3.8.2-7.el5_5.5
@mdg
mdg / gist:916683
Created April 12, 2011 23:35
gm -version
GraphicsMagick 1.3.7 2009-09-17 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2009 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
Feature Support:
Thread Safe yes
Large Files (> 32 bit) yes
Large Memory (> 32 bit) yes
BZIP yes
@mdg
mdg / gist:916670
Created April 12, 2011 23:25
exiftool problem.jpg
ExifTool Version Number : 8.40
File Name : problem.jpg
Directory : .
File Size : 637 kB
File Modification Date/Time : 2011:04:12 23:24:00+00:00
File Permissions : rw-r--r--
File Type : JPEG
MIME Type : image/jpeg
JFIF Version : 1.01
Exif Byte Order : Big-endian (Motorola, MM)