Skip to content

Instantly share code, notes, and snippets.

View marpontes's full-sized avatar

Marcello Pontes marpontes

View GitHub Profile
@marpontes
marpontes / gcloud-compose-squish.sh
Created July 22, 2021 14:10
Bash function that overcomes the limit of 32 files that `gsutil compose` can handle.
#!/bin/bash
# Based on:
# - https://stackoverflow.com/questions/66482517/how-to-append-more-than-33-files-in-a-gcloud-bucket#answer-66484002
GSUTIL="gsutil compose"
BATCH_SIZE="32"
BUCKET_BASE="gs://my-shiny-bucket/path/to/intermediate/composites"
# Will compose files in groups of maximum 32
@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;
@marpontes
marpontes / disable-gpu-mac.md
Created October 5, 2017 12:40
Pass --disable-gpu down to Electron apps on mac (Slack, Whatsapp, Trello, ...)

On my Macbook Pro (OS X El Capitan) I was having issues on Electron based apps. These apps had visual issues/glitches like blank screens, visual components showing only when hovering or transparent menus.

By opening with these comands, the problems disappeared.

open /Applications/Slack.app/ --args --disable-gpu
open /Applications/Trello.app/ --args --disable-gpu
open /Applications/Whatsapp.app/ --args --disable-gpu
@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({
--
-- 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 / 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 / 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 / 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 / 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
http://getbootstrap.com
https://chrome.google.com/webstore/detail/window-resizer/kkelicaakdanhinjdeammmilcgefonfh?hl=en
http://loudev.com