Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Carlos Eduardo carloseduardosx

🎯
Focusing
View GitHub Profile
@carloseduardosx
carloseduardosx / configure_git_hook.md
Last active Apr 18, 2019
Step by step to configure git hook
View configure_git_hook.md

1. Create a folder called "git_template"

2. Create a folder inside git_template called "hooks"

3. Create the hook file "prepare-commit-msg" inside the hooks folders and then place the following code inside it:

#!/bin/bash
orig_msg_file="$1"
temp="temp_message"
branch=$( git branch | grep '^\*' | cut -b3- )
task=$( sed -E "s/feature\/|hotfix\/|react\///g" <<< "$branch" )
@carloseduardosx
carloseduardosx / CapsLockCtrlEscape.ahk
Created Mar 14, 2019 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
View CapsLockCtrlEscape.ahk
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}
@carloseduardosx
carloseduardosx / BINs.md
Last active May 24, 2018
Regex for test BINs(Bank Identification Number)
View BINs.md

This is a list of Regex to match BINs of some credit/debit card brands

American Express

Possible prefixes

  • 34
  • 37
/^3[47]/g
@carloseduardosx
carloseduardosx / RxJavaSchedulersChangedRule.kt
Last active Dec 31, 2016
Simple JUnit TestRule for do something when Observable schedulers change
View RxJavaSchedulersChangedRule.kt
package com.carloseduardo.rules
import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement
import rx.Scheduler
import rx.android.plugins.RxAndroidPlugins
import rx.android.plugins.RxAndroidSchedulersHook
import rx.plugins.RxJavaHooks
import rx.schedulers.Schedulers
@carloseduardosx
carloseduardosx / AutoIncrementEntity.java
Last active Jan 18, 2021
RealmAutoIncrement is a singleton which maintain the last id saved from each database model
View AutoIncrementEntity.java
package com.carloseduardo.model;
import com.carloseduardo.constants.KnownClasses;
import com.carloseduardo.exception.UnknownModelException;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
import io.realm.annotations.Required;
/**
@carloseduardosx
carloseduardosx / RealmAutoIncrement.java
Last active Jan 18, 2021
RealmAutoIncrement is a singleton which maintain the last id saved from each database model
View RealmAutoIncrement.java
package com.carlosedurdo.database;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import io.realm.Realm;
import io.realm.RealmObject;
/**
@carloseduardosx
carloseduardosx / CriteriaBuilder.java
Last active Mar 29, 2016
Builder to hibernate criteria
View CriteriaBuilder.java
package com.carlosedurdo.core.builder;
import com.carlosedurdo.core.model.Criteria;
import com.carlosedurdo.core.util.ArrayUtil;
import org.hibernate.criterion.MatchMode;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;