Skip to content

Instantly share code, notes, and snippets.

View rmariuzzo's full-sized avatar
🤒
Fighting a cancer.

Rubens Mariuzzo rmariuzzo

🤒
Fighting a cancer.
View GitHub Profile
@rmariuzzo
rmariuzzo / gapps-shuffle-selected-slides.gs
Created October 19, 2020 14:22
GApps Script / Shuffle selected slides
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex
while (0 !== currentIndex) {
randomIndex = Math.floor(Math.random() * currentIndex)
currentIndex -= 1
temporaryValue = array[currentIndex]
array[currentIndex] = array[randomIndex]
array[randomIndex] = temporaryValue
}
@rmariuzzo
rmariuzzo / get-special-repos-from-dr.js
Created October 1, 2020 18:47
Get special repos from DR
var repos = await (await fetch('https://developersdo.github.io/opensource-data/repos.json')).json()
console.log(`Repos Total: ${repos.length}`)
var specialRepos = repos.filter(repo => {
var [login, name] = repo.name.split('/')
return login === name
})
console.log(`Special Repos Total: ${specialRepos.length}`)
#!/bin/bash
git checkout master
git pull origin master
git branch | grep -v "master\|develop" | xargs git branch -D
@rmariuzzo
rmariuzzo / auto-refresh.js
Created May 15, 2019 22:40
Refresh a web page when no mouse activity
// DO NOT COMMIT
(() => {
const keepAwake = () => {
clearTimeout(keepAwake.nod.timeoutId)
keepAwake.nod()
}
keepAwake.nod = () => {
keepAwake.nod.timeoutId = setTimeout(() => {
location.reload()
keepAwake.nod()
mkdir x-script
cd x-script
npm init
@rmariuzzo
rmariuzzo / ProfilerInterceptor.java
Last active July 24, 2020 06:24
How to profile Spring MVC request?
package com.mariuzzo.profiler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@rmariuzzo
rmariuzzo / preferences.json
Created December 24, 2014 14:17
rmariuzzo's Sublime Text preferences
{
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".sass-cache",
"node_modules",
@rmariuzzo
rmariuzzo / printlist.js
Last active August 29, 2015 14:03
printList will take a nested list of unknown depth and print each item on a separate line.
// Proposed solution for an exercise given to a friend: http://pastebin.com/hjFCZYE7
function printList(linePrefix, list) {
for (var i = 0; i < list.length; i++) {
if (typeof list[i] === 'string') {
console.log(linePrefix + '.' + i + ': ' + list[i]);
} else {
printList(linePrefix + '.' + i, list[i]);
}
}
use deleteme;
create table assets (
item_name varchar(32) primary key,
dynamic_cols blob
);
INSERT INTO assets VALUES
('MariaDB T-shirt', COLUMN_CREATE('campo_padre', COLUMN_CREATE('hijo', 'valor del hijo')));
@rmariuzzo
rmariuzzo / Horizontal-Menu-w-Arrows.markdown
Created April 23, 2014 23:06
A Pen by Rubens Mariuzzo.