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)
...
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 / 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 / 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
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
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 / dining.rs
Last active August 29, 2015 14:25
Rust Dining Philosphers implementation using fair Arbitrator solution
extern crate rand;
use std::thread;
use std::sync::Arc;
use std::sync::mpsc::{Sender, Receiver, channel};
use rand::Rng;
fn main() {
let waiter = Waiter::new();
@jeremyjh
jeremyjh / cocos_ref.cpp
Created October 10, 2014 16:44
simple cocs2d-x Ref integration to entityx
/*
* File: cocos_ref.h
* Author: jeremy
*
* Created on June 28, 2014, 8:38 PM
*/
#ifndef COCOS_REF_H
#define COCOS_REF_H