Skip to content

Instantly share code, notes, and snippets.

View ademar111190's full-sized avatar
Lightning Networking the Bitcoin

Ademar ademar111190

Lightning Networking the Bitcoin
  • CEO of Bitcoin
  • Itatiba
View GitHub Profile
@ademar111190
ademar111190 / onename
Created July 26, 2016 14:07
just a verification
Verifying that +ademar111190 is my blockchain ID. https://onename.com/ademar111190
@ademar111190
ademar111190 / .gitconfig
Last active September 20, 2018 17:48
Some .gitconfig alias
[alias]
a = add
b = branch
bc= checkout -b
bb= log --graph --simplify-by-decoration --pretty=format:'%d' --all
c = commit
cl= clean -f -d
d = diff
dc= diff --cached
e = shortlog --summary --numbered
@ademar111190
ademar111190 / .gitignore
Last active January 12, 2019 17:47
Some .zprofile commands
.profile_secrets
vim
@ademar111190
ademar111190 / firebase.sh
Created June 22, 2016 17:51
A script to send data notifications
#!/bin/bash
# https://github.com/firebase/firebase-tools
# https://firebase.google.com/docs/cloud-messaging/server
DEVICE="<< DEVICE TOKEN >>"
KEY="<< SERVER KEY>>"
JSON="
{
\"to\": \"$DEVICE\",
@ademar111190
ademar111190 / Cpf.java
Created April 27, 2016 14:05
A CPF validator for java and Android, CPF is a brazilian document
import java.util.regex.Pattern;
public class Cpf {
private static Pattern PATTERN_GENERIC = Pattern.compile("[0-9]{3}\\.?[0-9]{3}\\.?[0-9]{3}\\-?[0-9]{2}");
private static Pattern PATTERN_NUMBERS = Pattern.compile("(?=^((?!((([0]{11})|([1]{11})|([2]{11})|([3]{11})|([4]{11})|([5]{11})|([6]{11})|([7]{11})|([8]{11})|([9]{11})))).)*$)([0-9]{11})");
public static boolean isValid(String cpf) {
if (cpf != null && PATTERN_GENERIC.matcher(cpf).matches()) {
cpf = cpf.replaceAll("-|\\.", "");
@ademar111190
ademar111190 / .gitignore
Last active September 7, 2015 23:04
EP1 - Reconhecimento de padrões
out/
@ademar111190
ademar111190 / levenshtein.kt
Last active April 28, 2025 09:11
Levenshtein Distance algorithm implementation using Kotlin
import kotlin.math.min
fun levenshtein(lhs : CharSequence, rhs : CharSequence) : Int {
if(lhs == rhs) { return 0 }
if(lhs.isEmpty()) { return rhs.length }
if(rhs.isEmpty()) { return lhs.length }
val lhsLength = lhs.length + 1
val rhsLength = rhs.length + 1
@ademar111190
ademar111190 / RecyclerItemClickListener.java
Created August 6, 2015 15:17
RecyclerItemClickListener example
import android.support.v7.widget.RecyclerView;
import android.view.GestureDetector;
import android.view.MotionEvent;
public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener {
private GestureDetector mGestureDetector;
public RecyclerItemClickListener(Context context) {
mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
@ademar111190
ademar111190 / README.md
Last active August 29, 2015 14:25
Just a study of biological sequence and how Dynamic Programming Alignment works

#Dynamic Programming

Just a study of biological sequence and how Dynamic Programming Alignment works

#How to

./dynamicProgramming.py -a ATA -b GATC > result.json

the result is a json that contains contains:

@ademar111190
ademar111190 / .gitconfig
Last active August 29, 2015 14:24
Git config
[user]
email = [email protected]
name = Ademar Alves de Oliveira
[push]
default = simple
[alias]
a = add
b = branch
c = commit
d = diff