Skip to content

Instantly share code, notes, and snippets.

Elvis Souza mageddo

Block or report user

Report or block mageddo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mageddo
mageddo / re4-lmb-rmb-on-keyboard.awk
Created Apr 5, 2020
Resident Evil 4: Activate LMB + RMB on keyboard instead
View re4-lmb-rmb-on-keyboard.awk
;
#UseHook
#MaxHotkeysPerInterval 200 ;example from Help file
#IfWinActive, ahk_exe bio4.exe
CoordMode, Mouse, Screen
~*RAlt::
global Chat
@mageddo
mageddo / main.js
Last active Mar 26, 2020
Steam wishlist JSON generator
View main.js
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 Feb 22, 2020
FFmpeg split and set initial video incrementer
View ffmpeg-splliter.sh
#!/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 Jan 26, 2020
Convert Video To Youtube Format
View v1.sh
#!/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 Jan 24, 2020
Ignore specific checkstyle rule
View README.md

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 Jan 17, 2020
Simple way to create REST docs
View README.md

Listar arquivos de um diretório

GET /op/files/ HTTP/1.1

Parameters

Name Type Decription
@mageddo
mageddo / InMemoryRestServer.java
Last active Jan 20, 2020
InMemoryRestServer for apiclient unit tests
View InMemoryRestServer.java
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 Jan 13, 2020
Parse aws dynamo events.DynamoDBAttributeValue to Struct
View main.go
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))
View .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
charset = utf-8
@mageddo
mageddo / script.sh
Last active Jan 1, 2020
Convert multiple videos inside dir
View script.sh
set -e
export AV_LOG_FORCE_NOCOLOR=1 &&\
FILES_TO_CONVERT="$(ls *.mp3)" &&\
TOTAL=$(echo "$FILES_TO_CONVERT" | wc -l) &&\
I=0 &&\
OUT_DIR=converted && mkdir -p ${OUT_DIR} &&\
(IFS='
'
for IN in $FILES_TO_CONVERT; do
You can’t perform that action at this time.