Skip to content

Instantly share code, notes, and snippets.

View marpontes's full-sized avatar

Marcello Pontes marpontes

View GitHub Profile
@marpontes
marpontes / gist:8919021
Last active August 29, 2015 13:56
Idea for CEP [brazilian postal code] GEO webservice - this is a sample document that will be store in Mongodb postal collection.
/*
* Model of document to be stored, maintained and incremented
*/
{
"_id": "51111040",
"pos": [-35.2560503, -5.896805199999999],
"cntr": {
"n": "Brazil",
http://getbootstrap.com
https://chrome.google.com/webstore/detail/window-resizer/kkelicaakdanhinjdeammmilcgefonfh?hl=en
http://loudev.com
@marpontes
marpontes / pentahoday15-cde-bootstrap.md
Created May 27, 2015 15:49
Program and links to #pentahoday15 minicourse "Dashboards elegantes com CDE/Bootstrap"

Dashboards elegantes com CDE/Bootstrap

  1. Pré-requisitos
  • Web!
    • CSS
    • Javascript
    • Ajax
  • jQuery
@marpontes
marpontes / oncase-pentahoday15.md
Created May 27, 2015 16:49
Resumo do material da Oncase para o #pentahoday15

Palestras

Lista com links para download dos PDFs das apresentações utilizadas

   

Ferramentas de Mineração de dados com o PDI Mailson Santos @maialson

@marpontes
marpontes / conditional-running-totals.mdx
Created September 27, 2015 14:26
Some crazy MDX Demonstration to my fellow friend @maialson

WITH MEMBER [Measures].[one] as 1 MEMBER [Measures].[condic] as iif( inStr([Customers].currentMember.name,"a")>0, 0,[Measures].[one]) MEMBER [Measures].[Sequential] as rank( [Customers].currentMember, extract( nonEmptyCrossjoin( nonEmptyCrossjoin( [Territory].currentMember,

@marpontes
marpontes / drill-param-control.js
Last active December 20, 2015 10:31
This is basically an object created to make it easy to handle the multi-valued MDX-formatted inputs being passed down to another artifacts, from a Pentaho CDE Dashboard to an Analyzer Report, for example. If the parameter is mdx-like, is multi-valued and the first is "All", then it fits!
/*
* This is basically an object created to make it easy to
* Handle the multi-valued MDX-formatted inputs being passed down to
* another artifacts, from a CDE Dashboard to an Analyzer Report, for example
*
* by @marpontes
*
* Ex
* <div id="SupplierHolder">
* <select multiselect>
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
@marpontes
marpontes / offline-video-and-bindings.js
Created October 17, 2016 11:08
Reveal.js custom controls - offline video with custom key bindings
/*
Autoplay mp4 video and key bindings
*/
var vidIdx = 13;
var vidId = "demoVid";
var vid = document.getElementById(vidId);
Reveal.addEventListener( 'slidechanged', vidControl );
Reveal.addEventListener( 'ready', vidControl );
Reveal.configure({
@marpontes
marpontes / chart-responsivo.js
Created November 24, 2015 19:51
Habilitando os gráficos do CDE a responderem a mudanças de layout.
/* [Dashboards compatíveis com requirejs]
Solução componente a componente
--------------------------------------------------------------------
Colocar no Post Execution:
*/
function(){
var comp = this, elm = $("#"+comp.htmlObject);
$(window).resize(function(){
comp.chart.options.width = elm.width();
comp.chart.render(/*bypassAnimation*/true, /*recreate*/true, /*reload*/false);
@marpontes
marpontes / meet.jit.si-speaker-time-chart.js
Created April 29, 2020 15:44
Aggregates and charts speaker time using the meeting tool https://meet.jit.si
const aggSpeakerTime = () => $(".speaker-stats-item ")
.map((i, a) => ({
name: $(a).find('.speaker-stats-item__name').text(),
time: $(a).find('.speaker-stats-item__time').text()
}))
.toArray()
.sort((a, b) => a.name.substring(0, 1).toLowerCase() < b.name.substring(0, 1).toLowerCase() ? -1 : 1)
.reduce((acc, curr) => {
let data = acc[curr.name] || { seconds: 0 };
let mins = curr.time.match(/\d+m/) ? parseInt(curr.time.match(/\d+m/)[0].replace('m', ''), 10) : 0;