Skip to content

Instantly share code, notes, and snippets.

@skovsgaard
skovsgaard / hyperpolyglot-elixir
Last active May 17, 2022 14:58
The content for the Hyperpolyglot entry on Elixir
elixir
======
version used
------------
1.2
show version
------------
$ elixir -v
Hex: 0.10.1
Elixir: 1.2.0
OTP: 18.2.1
Built with: Elixir 1.2.1 and OTP 18.2.2
Registry file available (last updated: 2016-01-16 13:56:15)
Size: 1289kB (compressed 418kb)
Packages #: 1382
Versions #: 6095
@skovsgaard
skovsgaard / elixir101.ex
Created June 13, 2015 22:07
Plug setup
defmodule Elixir101 do
def prep, do: Elixir101.Builder.all
def start do
{:ok, _} = Plug.Adapters.Cowboy.http Elixir101.Server, []
end
end

Keybase proof

I hereby claim:

  • I am skovsgaard on github.
  • I am skovsgaard (https://keybase.io/skovsgaard) on keybase.
  • I have a public key whose fingerprint is ED36 6CC5 27E6 FDF7 D042 5AB1 0EC7 C18A 11A9 A7AF

To claim this, I am signing this object:

@skovsgaard
skovsgaard / index.js
Created December 12, 2014 10:43
simple-server
var net = require('net');
net.createServer(function(c) {
c.on('end', function() {
console.log('server disconnected');
});
c.write('OK - 2222 - From YOURNAME\r\n');
c.on('data', function(data) {
c.end();
});
}).listen(2222, function() {
@skovsgaard
skovsgaard / run_prod.sh
Created October 29, 2014 21:02
A one liner for running a Phoenix application open to the outside world.
#!/usr/bin/env bash
su -c "MIX_ENV=prod PORT=80 mix phoenix.start >> prod_out.log &"
#!/bin/bash
# Creates an empty coffeescript project.
PROJECT_NAME=$1
mkdir $PROJECT_NAME
cd $PROJECT_NAME
mkdir lib src
touch Cakefile
@skovsgaard
skovsgaard / Elixir gitignore
Created July 8, 2014 13:00
Elixir gitignore
_build
deps
ebin
erl_crash.dump
mix.lock
*.ez
*.beam