Skip to content

Instantly share code, notes, and snippets.

if (entity.getEntityType().equals(Org.ENTITY_TYPE)) {
memberGroups = this.securityGroupDao.findByOrg(entity.getId());
} else if (entity.getEntityType().equals(User.ENTITY_TYPE)) {
memberGroups = this.securityGroupDao.findByUser(entity.getId());
} else {
throw new Runt
@jmayaalv
jmayaalv / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<t:Loop t:source="permissions" t:value="permission">
<tr t:type="Zone" t:id="rowZone" id="prop:currentRowZoneId">
<td>${permission.id}</td>
<td>${permission.name}</td>
<td>
<t:if test="authorized ">
<img src="${context:img/green.png}" style="height: 16px;"/>
</t:if>
<t:if test="!authorized ">
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<path>/ims</path>
<systemProperties>
<tapestry.production-mode>false</tapestry.production-mode>
<tapestry.execution-mode>Development</tapestry.execution-mode>
</systemProperties>
stguatdb=> \d trd_product_configuration
Table "ims.trd_product_configuration"
Column | Type | Modifiers
-----------------+--------+-----------
productid | bigint | not null
configurationid | bigint | not null
Indexes:
"trd_product_configuration_pkey" PRIMARY KEY, btree (productid, configurationid)
Foreign-key constraints:
"trd_product_configuration_configurationid_fk" FOREIGN KEY (configurationid) REFERENCES trd_configuration(configurationid)
@jmayaalv
jmayaalv / gist:72b779f61a67a0e70b79
Created September 24, 2015 16:23
index_product_config.sql
insert into trd_tenant (id, code) values (108835, 'NAV');
insert into trd_product (productid, active, code, name, tenantid)
values (nextval('seq_trd_product'), true, 'slf_implicit_pricing', 'SLF: Implicit Pricing', 108835);
insert into trd_configuration (configurationid, fund_type, sequence_type, valid_from, creation_date)
values (nextval('seq_trd_configuration'), 40, 'SURRENDER_FIRST', now(), now());
insert into trd_product_configuration (productid, configurationid)
select (select productid from trd_product where code = 'slf_implicit_pricing') as productid,
@jmayaalv
jmayaalv / gist:7f2c999f91411e876243
Created September 24, 2015 16:23
index_product.sql
insert into trd_tenant (id, code) values (108835, 'NAV');
insert into trd_product (productid, active, code, name, tenantid)
values (nextval('seq_trd_product'), true, 'slf_implicit_pricing', 'SLF: Implicit Pricing', 108835);
insert into trd_configuration (configurationid, fund_type, sequence_type, valid_from, creation_date)
values (nextval('seq_trd_configuration'), 40, 'SURRENDER_FIRST', now(), now());
insert into trd_product_configuration (productid, configurationid)
select (select productid from trd_product where code = 'slf_implicit_pricing') as productid,
stg:prod)
SRCDIR=/Users/jmaya/Documents/workspace/release/st_george/prod/beluca
DESTDIR=stage-ims
DESTSERVER=stgweb1
IMSDIR=/usr/local/staging
cd $SRCDIR
git fetch origin
git co feature/st_george
mvn clean install -DskipTests=true
;;
@jmayaalv
jmayaalv / install-all.sh
Last active October 14, 2015 20:30
Downloads all ms dependencies and installs it locally
#!/bin/sh
set -x
BASE_DIR=$(pwd)
cd $BASE_DIR/common/beluca
git fetch origin common
git co common
git pull origin common
cd common
[10/19/15, 3:47:56 PM] Juan E. Maya: create role  slftestdb login password '^1mnuj7s';
[10/19/15, 3:48:11 PM] Juan E. Maya: create schema ims authorization slftestdb;
create schema pgcontrib;
grant all on schema ims to slftestdb;
grant all on schema pgcontrib to slftestdb;
alter user  slftestdb set search_path = ims, pgcontrib;
SET search_path TO ims, pgcontrib,public;
revoke create on schema public from public;
commit;