Skip to content

Instantly share code, notes, and snippets.

View ToddG's full-sized avatar

ToddG ToddG

View GitHub Profile
@ToddG
ToddG / HelloWebView.java
Created May 6, 2012 03:46
Simplified JavaFX Example
package hellowworld;
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.geometry.HPos;
import javafx.geometry.VPos;
import javafx.scene.Node;
import javafx.scene.Scene;
@ToddG
ToddG / TimerWebSocketServlet.java
Created July 4, 2012 15:05
AngularJS + Jetty + WebSockett Example : TimerWebSocketServlet
import org.eclipse.jetty.websocket.WebSocket;
import org.eclipse.jetty.websocket.WebSocketServlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
@ToddG
ToddG / install-python-2.7.sh
Created July 10, 2012 03:19
intalling python2.7 on centos 6.2
#from https://mythinkpond.wordpress.com/2011/12/28/how-to-upgrade-to-python-2-7-on-centos/
#
# Note: installs python27 (and pip) into /usr/local/bin
# I added this to update my enviroment:
#
# new file: /etc/profile.d/local-bin.sh
# contains the following line:
#
# export PATH=$PATH:/usr/local/bin
#
@ToddG
ToddG / rebar-reltool-relase-notes.md
Created September 15, 2012 16:46
using rebar to create an erlang app with a dependency, and then starting a release created with reltool

Summary

I'm trying to figure out how to use rebar to:

  • create erlang project
  • add a dependency on an erlang module from github
  • start the app via the erl console
  • create a release and start the app from the release (via the generated scripts)
@ToddG
ToddG / get_feed_srv.erl
Created September 16, 2012 16:46
erlang code to process a json feed : total wip, only downloads currently
-module(get_feed_srv).
-behaviour(gen_server).
-define(SERVER, ?MODULE).
%% ------------------------------------------------------------------
%% API Function Exports
%% ------------------------------------------------------------------
%%-export([start_link/0, get_feed/1, process_redirect/1, process_response/1]).
-export([start_link/0, get_feed/1]).
@ToddG
ToddG / shapesmith-notes-01.md
Created October 14, 2012 16:36
shapesmith notes

shapesmith notes

license

http://www.apache.org/licenses/LICENSE-2.0

Allows public/private derivations.

erlang

@ToddG
ToddG / sync-error-report.log
Created November 23, 2012 20:56
erlang sync results
=INFO REPORT==== 23-Nov-2012::15:50:22 ===
/home/todd/projects/mygit-repo/seed-master/desktop/erlang/cowboy/src/rest_echo.erl:37: Warning: function do_echo/2 is unused
/home/todd/projects/mygit-repo/seed-master/desktop/erlang/cowboy/src/rest_echo.erl:44: Warning: function extract_parameter/2 is unused
/home/todd/projects/mygit-repo/seed-master/desktop/erlang/cowboy/src/rest_echo.erl:49: Warning: function format_response/1 is unused
/home/todd/projects/mygit-repo/seed-master/desktop/erlang/cowboy/src/rest_echo.erl:0: Recompiled with 1 warnings
=ERROR REPORT==== 23-Nov-2012::15:50:26 ===
Unable to determine options for "/home/todd/bin/erlang/otp/lib/compiler/src/R15B02/lib/compiler-4.8.2/src/beam_asm.erl"
=ERROR REPORT==== 23-Nov-2012::15:50:26 ===
Unable to determine options for "/home/todd/bin/erlang/otp/lib/compiler/src/R15B02/lib/compiler-4.8.2/src/beam_block.erl"
@ToddG
ToddG / Makefile
Created December 15, 2012 15:36
trimmed down makefile for creating embedded yaws app with external web app copied in, too.
PROJECT = embedded_yaws
REBAR = rebar
all: clean webapp deps compile
compile:
rebar get-deps compile
clean:
rebar clean
@ToddG
ToddG / launch.erl
Created December 15, 2012 15:39
simple launcher script to start an embedded yaws app
-module(launch).
%% API.
-export([start/0]).
%% API.
start() ->
{ok, Cwd} = file:get_cwd(),
Docroot = Cwd ++ "/webapp",
@ToddG
ToddG / rebar.config
Created December 15, 2012 15:41
rebar config for embedded yaws app
{erl_opts, [debug_info]}.
{deps, [
{yaws, ".*", {git, "git://github.com/klacke/yaws", {tag, "yaws-1.94"}}},
{mochiweb, ".*", {git, "git://github.com/mochi/mochiweb.git", "master"}},
{mimetypes, ".*", {git, "git://github.com/spawngrid/mimetypes.git", "master"}}
]}.