Skip to content

Instantly share code, notes, and snippets.

View mageddo's full-sized avatar
💭
🚲 🍺

Elvis Souza mageddo

💭
🚲 🍺
View GitHub Profile
@mageddo
mageddo / Agent.java
Created March 12, 2023 16:29
Agent.java
import java.util.concurrent.CountDownLatch;
import sun.misc.Signal;
public class Agent {
private final CountDownLatch shutdownLatch;
public Agent() {
this.shutdownLatch = new CountDownLatch(1);
}
@mageddo
mageddo / script.js
Created March 5, 2023 18:11
Tampermonkey script to fix github emojis on Linux
// ==UserScript==
// @name GitHub Emoji on Linux
// @description Convinces GitHub that Linux supports emoji by removing Linux from the user-agent.
// @version 1
// @namespace https://userscripts.kevincox.ca
// @match https://github.com/*
// @run-at document-start
// ==/UserScript==
!function(){
"use strict";
@mageddo
mageddo / build.gradle
Created February 28, 2023 03:08
Atualizar arquivos com a versão nova e não com a atual, não gerando tag
plugins {
id "java"
id 'net.researchgate.release' version '3.0.2'
}
release {
project.ext.set("release.useAutomaticVersion", true)
git {
requireBranch.set("")
}
@mageddo
mageddo / CustomObjectMapper.java
Created January 31, 2023 04:07
WRITING JSON REST SERVICES
import com.fasterxml.jackson.databind.ObjectMapper;
import io.quarkus.jackson.ObjectMapperCustomizer;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
import javax.inject.Singleton;
public class CustomObjectMapper {
// Replaces the CDI producer for ObjectMapper built into Quarkus
@mageddo
mageddo / .gitattributes
Last active October 10, 2023 15:17
Programmer Utils
# version: 1.0.4
# https://help.github.com/articles/dealing-with-line-endings/
*.java text eol=lf
*.cpp text eol=lf
*.kt text eol=lf
*.c text eol=lf
*.go text eol=lf
*.sql text eol=lf
@mageddo
mageddo / build.gradle
Created December 28, 2022 03:04
Proguard
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.guardsquare:proguard-gradle:7.3.0'
}
}
@mageddo
mageddo / ffmpeg-mp4-to-animated-webp.md
Created November 16, 2022 22:51 — forked from witmin/ffmpeg-mp4-to-animated-webp.md
Convert MP4 file to animated WebP in ffmpeg

Convert MP4 file to animated WEBP file in ffmpeg CLI

1. Install ffmpeg CLI through homebrew

In terminal.app, install ffmpeg through homebrew

brew install ffmpeg

Validate the installation:

@mageddo
mageddo / sub.ass
Created October 30, 2022 01:40
Ass Example | SubStation_Alpha
[Script Info]
; Print = https://i.imgur.com/zAATUaF.jpg
; https://en.wikipedia.org/wiki/SubStation_Alpha
; This is a Sub Station Alpha v4 script.
; For Sub Station Alpha info and downloads,
; go to http://www.eswat.demon.co.uk/
Title: Neon Genesis Evangelion - Episode 26 (neutral Spanish)
Original Script: RoRo
Script Updated By: version 2.8.01
ScriptType: v4.00
@mageddo
mageddo / ScreenSaverPreventMain.java
Created September 30, 2022 19:41
ScreenSaver Prevent
import java.awt.*;
import java.time.Duration;
/**
* Move the mouse by one pixel every 3 minutes to prevent screen saver to start,
* useful when you dont have the right permissions to change that
* https://stackoverflow.com/questions/4231458/moving-the-cursor-in-java
* https://stackoverflow.com/questions/1439022/get-mouse-position
*/
public class ScreenSaverPreventMain {
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.time.Duration;
import javax.sql.DataSource;
import com.mageddo.db.StmUtils;