Skip to content

Instantly share code, notes, and snippets.

View madebyjeffrey's full-sized avatar

Jeffrey Drake madebyjeffrey

View GitHub Profile
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
This file has been truncated, but you can view the full file.
M190 S80.000000
M109 S235.000000
;Sliced at: Thu 23-06-2016 23:38:53
;Basic settings: Layer height: 0.2046 Walls: 0.7 Fill: 20
;Print time: 1 hour 4 minutes
;Filament used: 3.546m 10.0g
;Filament cost: None
;M190 S80 ;Uncomment to add your own bed temperature line
;M109 S235 ;Uncomment to add your own temperature line
G21 ;metric values

I think that folks are finally showing up to the Elixir party and (for the most part) liking what they see :)

I have only a small handful of criticisms after playing with Elixir for a while (which so far all seem like "Haskell is better in these areas," although I seem to still like Elixir better overall!)

  1. you can't define/override (per lexical scope) arbitrary infix operators, you are restricted to a small set. (In Haskell, for example, you can call any prefix function as an infix function.)

  2. you don't have any automatic currying. That's more Erlang's fault. Haskell has this, of course. In Elixir's defense, it's probably possible to define a curryable function definer using macros, like "defcurryable". Because, you know, what the hell CAN'T you do with macros? :) And Elixir has them.

  3. there is no clear distinction made between code with side effects and code without side effects. This is yet another thing I think Haskell gets right, because you can prove determinism when you can prove no side effe

//
// expected.hpp
// LiveNet
//
// Created by Jeffrey Drake on 1/3/2014.
// Copyright (c) 2014 Jeffrey Drake. All rights reserved.
//
#ifndef LiveNet_expected_hpp
#define LiveNet_expected_hpp
@madebyjeffrey
madebyjeffrey / fib.cpp
Created October 9, 2012 20:46
Fibonacci implementations
// C++ 11
#include <iostream>
#include <utility>
#include <string>
long long BinaryFib(long k)
{
$ cabal install happstack-heist
Resolving dependencies...
cabal: cannot configure happstack-server-7.0.2. It requires blaze-html ==0.5.*
For the dependency on blaze-html ==0.5.* there are these packages:
blaze-html-0.5.0.0. However none of them are available.
blaze-html-0.5.0.0 was excluded because xmlhtml-0.1.7 requires blaze-html
>=0.3.2 && <0.5
blaze-html-0.5.0.0 was excluded because heist-0.8.0 requires blaze-html
==0.4.*
/* example question implementation in spirit:
7. Construct an attribute grammar for the language L so that:
@ has value 2
*@* has value 4 - surrounding an expression with two stars squares its value
(@) has value 3 - putting brackets around an expressions adds 1 to the value
((@)) has value 4
(*(@)*) has value 10
((*((@))*)) has value 18
(((*(*(@)*)*))) has value 103
make "AR_FLAGS=rc" "CC_FOR_BUILD=gcc" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2" "CFLAGS_FOR_BUILD=-g -O2" "CFLAGS_FOR_TARGET=-g -O2" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "JC1FLAGS=" "LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCFLAGS_FOR_TARGET=-g -O2" "MAKE=make" "MAKEINFO=makeinfo --split-size=5000000 --split-size=5000000 " "PICFLAG=" "PICFLAG_FOR_TARGET=" "SHELL=/bin/sh" "RUNTESTFLAGS=" "exec_prefix=/opt/arm" "infodir=/opt/arm/share/info" "libdir=/opt/arm/lib" "prefix=/opt/arm" "includedir=/opt/arm/include" "AR=/opt/arm/arm-none-eabi/bin/ar" "AS=/Users/drakej/.work/bone/gcc-4.7-20120114/build/./gcc/as" "CC=/Users/drakej/.work/bone/gcc-4.7-20120114/build/./gcc/xgcc -B/Users/drakej/.work/bone/gcc-4.7-20120114/build/./gcc/ -B/opt/arm/arm-none-eabi/bin/ -B/opt/arm/arm-none-eabi/lib/ -isystem /opt/arm/arm-none-eabi/include -isystem /opt/arm/arm-none-eabi/sys-include " "CXX=arm-none-eabi-c++ -B/opt/arm/arm-none-eabi/bin/
OBJC ui/cocoa.o
cc1obj: warning: command line option ‘-Wignored-qualifiers’ is valid for C/C++ but not for ObjC [enabled by default]
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:120:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
from ui/cocoa.m:25:
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:75:24: error: expected identifier or ‘(’ before ‘^’ token
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:78:1: error: expected identifier before ‘end’
In file included from /System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:9:0,
from /System/Library/Frameworks/AppKit.framework/Headers/NSView.h:8,
from /System/Library/Frameworks/AppKit.framework/Headers/NSText.h:8,
@madebyjeffrey
madebyjeffrey / gist:1574037
Created January 7, 2012 06:56
ZZing's phonemes
Vowels:
Letter, IPA, English example
A ɑ f/a/ther
æ e c/a/t
E ɛ p/e/t
I i sh/ee/t
O oʊ c/oa/t
U u sh/oo/t