Skip to content

Instantly share code, notes, and snippets.

View splinter's full-sized avatar

Sameera Medagammaddegedara splinter

View GitHub Profile
@splinter
splinter / gist:6249520
Last active December 21, 2015 04:29
Basic usage of the snoop helper
var context={
fruits:[
{
name:'apples',
label:'I like salted apples',
value:'1',
info:{
some_data:'Have some more apples!'
@splinter
splinter / user.js
Created April 11, 2016 07:01
Accessing the logged in user in the ES/G-Reg Publisher
var server = require('store').server;
var user = server.current(session);
print('username : '+ user.username);
@splinter
splinter / store-user.js
Last active April 11, 2016 10:11
Accessing tenant details for the current user in the ES/G-Reg Store
var tenantApi = require('/modules/tenant-api.js').api;
var tenantDetails = tenantApi.createTenantDetails(request,session);
print('Tenant Id: '+tenantDetails.tenantId);
print('Tenant domain: '+tenantDetails.domain);
var renderLCActions = function() {
var container = config(constants.CONTAINER_LC_ACTION_AREA);
var impl = LifecycleAPI.lifecycle();
var actions;
var action;
// var action;
if (impl) {
actions = impl.actions();
var data = {};
var map = data.actions = [];
@splinter
splinter / ws-demo.js
Last active June 2, 2016 13:32
Sample usage of the Jaggery WS module
var ws = require('ws');
var log = new Log();
var stub = new ws.WSStub('http://api.bioinfo.no/wsdl/EchoService.wsdl');
Object.keys(stub.services.EchoService.operations).forEach(function(key){log.info('key ' + key)});
var sayHi = stub.services.EchoService.operations.SayHi;
var payload = sayHi.payloadXML();
payload = payload.replace('?','Meow');
log.info(sayHi.request(payload));
.my-icon {
background: transparent url(../img/gadget.png) no-repeat center;
padding: 9px;
}
.my-icon.fw-lg {
width:30px;
height:30px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
{{> title}}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
asset.configure = function(){
return {
meta: {
ui: {
icon:'my-icon'
}
}
};
};
~
<link rel="icon" href="{{url "/themes/default/img/favicon.png"}}" type="image/x-icon" />
<!-- Bootstrap -->
<link href="{{url "/themes/default/css/bootstrap.min.css"}}" rel="stylesheet" media="screen">
<!-- fontawesome -->
<link rel="stylesheet" href="{{url "/themes/default/css/font-awesome.min.css"}}">
<!-- font-wso2 -->
<table name="Tests">
<field type="text">
<name label="Test File">plan</name>
</field>
</table>