Skip to content

Instantly share code, notes, and snippets.

View 5alamander's full-sized avatar

ForgiveMyAwfulEngilsh 5alamander

View GitHub Profile
(*
ParserLibrary.fsx
Final version of a parser library.
Related blog post: http://fsharpforfunandprofit.com/posts/understanding-parser-combinators-3/
*)
module TextInput =
open System
@5alamander
5alamander / authorize_job_poster_1.ex
Created April 21, 2017 14:48 — forked from mileszs/authorize_job_poster_1.ex
Use new fun toys or not?
defmodule ElixirJobBoard.Plugs.AuthorizeJobPoster do
import Plug.Conn
import Phoenix.Controller, only: [put_flash: 3, redirect: 2]
alias ElixirJobBoard.Repo
alias ElixirJobBoard.User
alias ElixirJobBoard.Job
def init(opts), do: opts
@5alamander
5alamander / server.ex
Created November 20, 2016 17:06 — forked from adnils/server.ex
Elixir TCP echo server
defmodule Echo.Server do
def start(port) do
tcp_options = [:binary, {:packet, 0}, {:active, false}]
{:ok, socket} = :gen_tcp.listen(port, tcp_options)
listen(socket)
end
defp listen(socket) do
{:ok, conn} = :gen_tcp.accept(socket)
spawn(fn -> recv(conn) end)
@5alamander
5alamander / DecoratorEditor.cs
Last active April 17, 2024 00:25 — forked from liortal53/DecoratorEditor.cs
Unity, Custom Menu, decorate the build in editor
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// A base class for creating editors that decorate Unity's built-in editor types.
/// </summary>
public abstract class DecoratorEditor : Editor