Skip to content

Instantly share code, notes, and snippets.

View TheRyanBurke's full-sized avatar

Ryan Burke TheRyanBurke

View GitHub Profile
public class ByteUtil {
/* ========================= */
/* "primitive type --> byte[] data" Methods */
/* ========================= */
public static byte[] toByta(byte data) {
return new byte[]{data};
}
@TheRyanBurke
TheRyanBurke / UserManagerController.java
Created December 15, 2011 23:38
Coffeescript and Backbone.js impl of a simple Play! Groovy template
public class UserManager extends Controller {
public static void index() {
if (getUser() == null) {
flash.error("Cannot use User Manager - Please log in");
RingDNAController.index();
} else
renderArgs.put(CURRENT_USER, getUser());
List<User> users = getUsersFromOrg();
@TheRyanBurke
TheRyanBurke / vaadin-ipc-liferay.java
Created August 11, 2011 14:35
Vaadin IPC with Liferay add-on
public class DevicesPortlet extends Application implements PortletListener{
LiferayIPC liferayIPC = new LiferayIPC();
@Override
public void init() {
Window mainWindow = new Window("Device Portlet");
setMainWindow(mainWindow);
@TheRyanBurke
TheRyanBurke / 2 controllers
Created May 22, 2011 05:10
how to send param from one method to another
class TeamsController < ApplicationController
def create
@team = Team.new(params[:team])
respond_to do |format|
if @team.save
p "team-controller: #{@team.id}" #Loren: this is showing a value
format.html { redirect_to("/memberships/create", :team_id => @team.id) }#, :notice => 'Team was successfully created.') }
format.xml { render :xml => @team, :status => :created, :location => @team }
else