Skip to content

Instantly share code, notes, and snippets.

View mageddo's full-sized avatar
💭
🚲 🍺

Elvis Souza mageddo

💭
🚲 🍺
View GitHub Profile
@import url("https://fonts.googleapis.com/css?family=Lato:300,400,700");
/*!
* bootswatch v3.3.7
* Homepage: http://bootswatch.com
* Copyright 2012-2017 Thomas Park
* Licensed under MIT
* Based on Bootstrap
*/
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
@mageddo
mageddo / main.awk
Last active October 1, 2022 03:31
Resident Evil 4: Activate LMB + RMB on keyboard instead
; auto hot keys version = 1.1.34.04
; sends a and d + lmb + rmb
; author: @mageddo
; release date: 2020-04-05
; updated at: 2022-09-30
; version: v1.1
#UseHook
#MaxHotkeysPerInterval 200 ;example from Help file
@mageddo
mageddo / main.js
Last active March 26, 2020 04:48
Steam wishlist JSON generator
var games = [];
jQuery(".wishlist_row").each(function(){
games.push(toGame(jQuery(this)));
});
var str = "";
games.forEach(it => {
str += it.name + "\t" + it.originalPrice + "\t" + it.price + "\n";
});
console.log(str);
@mageddo
mageddo / ffmpeg-splliter.sh
Last active February 22, 2020 18:03
FFmpeg split and set initial video incrementer
#!/bin/bash
read -e -r -p 'input file? ' in;
read -e -i 'edited/' -r -p 'out dir? ' outDir;
read -e -r -p 'out file prefix? ' out;
read -e -i '1' -r -p 'start counter from which number? ' startCounter;
read -e -i '00:05:00' -r -p 'split size? ' splitSize;
tmpdir=$(mktemp -d)
outDir=$(echo $outDir | grep -o ".*[^/]")
@mageddo
mageddo / v1.sh
Last active October 9, 2021 17:44
Convert Video To Youtube Format
#!/bin/bash
export AV_LOG_FORCE_NOCOLOR=1 &&\
FILES_TO_CONVERT=(*.MOV) &&\
TOTAL=${#FILES_TO_CONVERT[@]} &&\
I=0 &&\
OUT_DIR=converted && mkdir -p ${OUT_DIR} &&\
for IN in "${FILES_TO_CONVERT[@]}"; do
I=$((I + 1)) &&\
OUT="${OUT_DIR}/${IN%.*}-30-fps.mp4" &&\
@mageddo
mageddo / README.md
Created January 24, 2020 20:40
Ignore specific checkstyle rule

Check out the use of the supressionCommentFilter at http://checkstyle.sourceforge.net/config_filters.html#SuppressionCommentFilter. You'll need to add the module to your checkstyle.xml

<module name="SuppressionCommentFilter"/>

and it's configurable. Thus you can add comments to your code to turn off checkstyle (at various levels) and then back on again through the use of comments in your code. E.g.

//CHECKSTYLE:OFF
public void someMethod(String arg1, String arg2, String arg3, String arg4) {
//CHECKSTYLE:ON
@mageddo
mageddo / README.md
Created January 17, 2020 21:55
Simple way to create REST docs

Listar arquivos de um diretório

GET /op/files/ HTTP/1.1

Parameters

Name Type Decription
@mageddo
mageddo / InMemoryRestServer.java
Last active January 20, 2020 14:14
InMemoryRestServer for apiclient unit tests
import org.junit.rules.ExternalResource;
import spark.Spark;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.ServerSocket;
public class InMemoryRestServer extends ExternalResource {
public static final String HOST = "localhost";
@mageddo
mageddo / main.go
Last active January 13, 2020 19:18
Parse aws dynamo events.DynamoDBAttributeValue to Struct
func UnmarshalEvent(attribute map[string]events.DynamoDBAttributeValue, out interface{}) error {
dbAttrMap := make(map[string]*dynamodb.AttributeValue)
for k, v := range attribute {
var dbAttr dynamodb.AttributeValue
bytes, marshalErr := v.MarshalJSON()
if marshalErr != nil {
return marshalErr
}
if err := json.Unmarshal(bytes, &dbAttr); err != nil {
return errors.WithMessage(err, fmt.Sprintf("can't umarshal: %s", attribute))
# deprecated, use: https://github.com/mageddo/codestyle/blob/master/.editorconfig
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true