Skip to content

Instantly share code, notes, and snippets.

View labmorales's full-sized avatar

André Morales labmorales

  • Cosm
  • Brasília, Brazil
View GitHub Profile
AC : Acre
AL : Alagoas
AP : Amapá
AM : Amazonas
BA : Bahia
CE : Ceará
DF : Distrito Federal
ES : Espírito Santo
GO : Goiás
MA : Maranhão
@labmorales
labmorales / install_pdo_sqlsrv.sh
Created January 11, 2018 19:15 — forked from joecampo/install_pdo_sqlsrv.sh
Install Official MSSQL driver for Unbuntu 14.04 - pdo_sqlsrv
#!/bin/bash
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo -i export CPPFLAGS="-DSIZEOF_LONG_INT=8"
sudo apt-get -y install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
cd ~
echo "Configuring the unixODBC 2.3.1 Driver Manager"

Quake log parser

Task 1

Construa um parser para o arquivo de log games.log.

O arquivo games.log é gerado pelo servidor de quake 3 arena. Ele registra todas as informações dos jogos, quando um jogo começa, quando termina, quem matou quem, quem morreu pq caiu no vazio, quem morreu machucado, entre outros.

O parser deve ser capaz de ler o arquivo, agrupar os dados de cada jogo, e em cada jogo deve coletar as informações de morte.

@labmorales
labmorales / drupal_menu_positioning.js
Created June 7, 2019 15:19
Drupal 8 - Menu Positioning Script
(function ($) {
var userLoggedIn = $('body.user-logged-in').length ? true:false;
// Only Runs if logged In
if(userLoggedIn){
$(window).resize(positionMenuIfLoggedPosition);
window.onload = function(){
positionMenuIfLoggedPosition();
};
initMenuPositionObserverMutator();
@labmorales
labmorales / functions.php
Created July 9, 2021 20:48
How to make WP Crop Thumbnails plugin and Webp Express work together
<?php
function convert_webp_crop_thumbnail($fullFilePath, $imageSizeName, $sizes) {
if (defined('WEBPEXPRESS_PLUGIN')) {
\WebPExpress\HandleUploadHooks::handleMakeIntermediateSize($fullFilePath);
}
}
add_action("crop_thumbnails_after_save_new_thumb", "convert_webp_crop_thumbnail", 10, 3);
@labmorales
labmorales / supported_timezones.js
Created December 7, 2023 13:28
iOS Hermes timezone Intl test
const timezones = [
'Africa/Abidjan',
'Africa/Accra',
'Africa/Addis_Ababa',
'Africa/Algiers',
'Africa/Asmara',
'Africa/Asmera',
'Africa/Bamako',
'Africa/Bangui',
'Africa/Banjul',