Skip to content

Instantly share code, notes, and snippets.

/**
* y3d is a WebGL library built with yui3
*
* https://github.com/brunofarache/y3d
*/
/**
* Examples: load y3d scripts from gists, click on it to see more examples
* Save: saves code to anonymous public gist
* Run: runs code (Crtl+U shortcut)
/**
* https://gist.github.com/brunofarache/5819929
*/
YUI({ gallery: 'gallery-2013.10.24-18-05' }).use('gallery-y3d', function(Y) {
var scene = new Y.Scene({
camera: new Y.Camera({
position: {
z: 20
}
/**
* Click on the left canvas and then move camera with wasd keys.
* Use mouse wheel to zoom in and zoom out.
*
* https://gist.github.com/brunofarache/5853591
*/
YUI().use('y3d-anim', 'y3d-scene', 'y3d-camera', 'y3d-geometry-box', 'y3d-geometry-sphere', 'y3d-texture', function(Y) {
var camera = new Y.Camera({
position: {
/**
* Click on the box, it should change to a random color.
*
* https://gist.github.com/brunofarache/5855622
*/
YUI().use('y3d-picker-plugin' ,'y3d-scene', 'y3d-geometry', 'node', function(Y) {
var scene = new Y.Scene({
background: '#272822'
});
/**
* Loading a teapot.obj file
*
* https://gist.github.com/brunofarache/6228194
*/
YUI().use('y3d-scene', 'y3d-camera', 'y3d-obj-loader', 'io-base', function(Y) {
var scene = new Y.Scene({
camera: new Y.Camera({
position: {
Map<Integer, Integer> collided = new HashMap<Integer, Integer>();
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 7; j++) {
Vec3D hand = hands[i];
AABB box = boxes[j];
if (box.containsPoint(hand) && pointClassification.equals(cutPlane.classifyPoint(hand, 0).toString())) {
boolean triggered = (collided.get(i) == j);
import com.liferay.mobile.sdk.MobileSDKBuilder;
MobileSDKBuilder.build(
MobileSDKBuilder.ANDROID, "http://localhost:8080",
"calendar-portlet", "com.liferay.calendar.mobile",
"/folder/destination");
public static void build(
String platform, String url, String context, String packageName,
String destination);
/**
* Copyright (c) 2000-2014 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
@brunofarache
brunofarache / gist:9254542
Created February 27, 2014 17:13
Uploading binaries with Liferay JSONWS
+ (void)upload:(NSData *)data folderId:(long)folderId
title:(NSString *)title mimeType:(NSString *)mimeType
requestDelegate:(id)requestDelegate
progressDelegate:(id)progressDelegate {
BOOL addGroupPermissions =
[self getAddGroupPermissions:[PrefsUtil getGroupType]];
BOOL addGuestPermissions =
[self getAddGuestPermissions:[PrefsUtil getGroupType]];
var Liferay = require('liferay');
// Session
var session = new Liferay.Session('http://localhost:8080', 'test@liferay.com', 'test'),
service = new Liferay.Calendar(session);
service.deleteCalendar(1, function (err, data) {
console.log(err, data);
});