Skip to content

Instantly share code, notes, and snippets.

View celorodovalho's full-sized avatar
🎯
Focusing

Rodovalho celorodovalho

🎯
Focusing
View GitHub Profile
@celorodovalho
celorodovalho / ArraySumTime.php
Last active November 29, 2020 20:58
Sum Array of Hours, Minutes, Seconds with PHP Carbon
function sumTime($entitiy)
{
$time = (array)$entitiy;
$time = array_filter($time, function ($item) {
return !in_array($item, ['00:00:00', '0:00:00']);
});
$begin = Carbon::createFromFormat('H:i:s', '00:00:00');
$end = clone $begin;
foreach ($time as $element) {
@celorodovalho
celorodovalho / phpdfbot.js
Created April 26, 2018 20:50
Google Script for PHPDFBOT
function phpDfBot() {
try {
var threads = GmailApp.search("(list:leonardoti@googlegroups.com OR list:clubinfobsb@googlegroups.com OR to:vagas@noreply.github.com OR to:clubinfobsb@googlegroups.com OR to:leonardoti@googlegroups.com) AND (subject:((desenvolvedor OR programador OR developer OR analista OR php OR web OR arquiteto OR dba OR suporte)) OR (desenvolvedor OR programador OR developer OR analista OR php OR web OR arquiteto)) is:unread", 0, 25);
Logger.log(threads.length);
for (var key in threads) {
var thread = threads[key];
var messages = thread.getMessages();
var label = GmailApp.getUserLabelByName("Não lidas");
var pattern = /<img.*src="([^"]*)"[^>]*>/;
var payload = {};
@celorodovalho
celorodovalho / screenfetch-custom-loki.sh
Last active December 1, 2017 18:11 — forked from xero/screenfetch-custom-arch.sh
Screenfetch - Custom ElementaryOS Loki logo
#!/usr/bin/env bash
# screenFetch - a CLI Bash script to show system/theme info in screenshots
# Copyright (c) 2010-2015 Brett Bohnenkamper <kittykatt@kittykatt.us>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.