Skip to content

Instantly share code, notes, and snippets.

@jeremyjh
jeremyjh / CMakeLists.txt
Created October 7, 2018 12:32
CMake script for building Godot (v2) in submodule
cmake_minimum_required(VERSION 3.5)
project(godot)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
include_directories(./godot
./godot/core/
./godot/core/math/)
file (GLOB CPP_FILES godot/**/*.cpp)
module Main where
import Control.Distributed.Process hiding (call)
import Control.Distributed.Process.Node as Node (initRemoteTable, runProcess, newLocalNode)
import Control.Distributed.Process.Extras (resolve, __remoteTable)
import Network.Transport.TCP
import Control.Concurrent (threadDelay)
import Control.Monad
import Network.Transport hiding (send)
import System.Environment
@jeremyjh
jeremyjh / LiftedExample.hs
Created December 5, 2013 01:55
an example using Lifted Process primitives with a custom monad stack
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Control.Distributed.Process.Lifted
( module Control.Distributed.Process
, module Control.Distributed.Process.Lifted
)
where
import Control.Monad.Trans.Control
...
defp deps do
[
{:phoenix, "~> 1.3.0"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.2"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.10"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:gettext, "~> 0.11"},

Keybase proof

I hereby claim:

  • I am jeremyjh on github.
  • I am jeremyjh (https://keybase.io/jeremyjh) on keybase.
  • I have a public key ASAPnvEfl1PGGYJVJ6pUh9nzgVMdDGKcdPDQ3C0vAqj9nQo

To claim this, I am signing this object:

@jeremyjh
jeremyjh / using-view.ex
Last active September 2, 2017 12:47
bigapp_web.ex defmacro __using__ clause
@webdir "bigapp_web"
@doc """
When used, dispatch to the appropriate controller/view/etc.
"""
defmacro __using__(:view) do
view_path =
__CALLER__.file
|> String.split(@webdir)
|> List.last
@jeremyjh
jeremyjh / bigapp_web.ex
Created September 2, 2017 12:24
bigapp_web alternate view head
def view(opts \\
[root: "lib/bigapp_web/templates",
namespace: BigappWeb]) do
quote do
use Phoenix.View, unquote(opts)
@jeremyjh
jeremyjh / bigapp_webdefview.ex
Created September 1, 2017 15:40
bigapp_web.ex def view pass opts
def view(opts) do
quote do
use Phoenix.View, unquote(opts)
# Import convenience functions from controllers
...
@jeremyjh
jeremyjh / bigapp_web.ex
Last active September 1, 2017 15:33
Web Context Example
defmodule BigappWeb do
@moduledoc """
The entrypoint for defining your web interface, such
as controllers, views, channels and so on.
This can be used in your application as:
use BigappWeb, :controller
use BigappWeb, :view
@jeremyjh
jeremyjh / NodeProcess.hs
Created December 5, 2013 01:24
example helpers to make cloud haskell easier in repl
-- Functions intended to make it easier to work with distributed-process
-- from the REPL.
module NodeProcess where
import Control.Distributed.Process
import Control.Distributed.Process.Serializable
import Control.Concurrent.MVar
import Control.Concurrent (threadDelay)