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 / alah
Created October 22, 2014 16:32
Show one of ninety nine allah`s names
#!/usr/local/bin/lua
Alah = {}
Alah.__index = Alah
function Alah:new(latin, arabic, portuguese)
o = {}
setmetatable(o, self)
self.__index = self
self.latin = latin
@ademar111190
ademar111190 / MyItemAnimator
Created August 20, 2014 18:00
Playing with ItemAnimator in the new Android RecyclerView
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
import java.util.ArrayList;
import java.util.List;
@ademar111190
ademar111190 / gist:453d5a7a4e75e7e5933f
Created June 26, 2014 21:25
Android & Java brazilian CPF and CEP pattern
import java.util.regex.Pattern;
public static final Pattern CPF = Pattern.compile("^([0-9]{3}\\.?){3}-?[0-9]{2}$");
public static final Pattern CEP = Pattern.compile("[0-9]{5}-?[0-9]{3}");
@ademar111190
ademar111190 / SearchViewFormatter.java
Last active March 16, 2023 10:44
An easy way to format SearchView's
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.ImageSpan;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SearchView;
import android.widget.TextView;
@ademar111190
ademar111190 / hexa.py
Created April 22, 2014 18:18
A script to generate current timestamp in hexadecimal
#!/usr/bin/python
'''
A script to generate current timestamp in hexadecimal
'''
from time import time
print hex(int(time()))
@ademar111190
ademar111190 / drc.sh
Created February 27, 2014 23:51
this is a more easy way of use the drawable_convert.py (https://gist.github.com/ademar111190/9261668) exaple of use: drc.sh image.png
#!/bin/bash
# this is a more easy way of use the drawable_convert.py
# https://gist.github.com/ademar111190/9261668
# this is a GPL 3+ script
# author Ademar Alves de Oliveira <[email protected]>
mkdir res res/drawable-hdpi res/drawable-mdpi res/drawable-xhdpi res/drawable-xxhdpi
mv $1 res/drawable-xxhdpi
drawable_convert.py -d res/drawable-mdpi -d res/drawable-hdpi -d res/drawable-xhdpi res/drawable-xxhdpi/$1
#!/usr/bin/python
import sys
import argparse
import os
import re
'''
A simple script to create lower-resolution Android drawables from higher-resolution ones.
@ademar111190
ademar111190 / extractIcon.sh
Created February 22, 2014 04:56
extract zips files from android ui utils
#!/bin/bash
# extract zips files from android ui utils:
# http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html
# this is a GPL 3+ script
# author Ademar Alves de Oliveira <[email protected]>
# how to use:
# extractIcon.sh file_with_icons.zip destination/folder
@ademar111190
ademar111190 / README.md
Last active August 29, 2015 13:56
Restart adb as root on linux

##Restart ADB as root a linux utilitie to android developers

##how to use

###dependencies

Your adb need be on PATH variable
You need sudo access
@ademar111190
ademar111190 / restartAdbOnFedoraAsRoot.sh
Last active January 3, 2016 22:19
A simple script to restart the adb (Android Debug Bridge) on Fedora. To use it follow the steps: 1> Save the script restartAdbOnFedoraAsRoot.sh on your PC. 2> Change the ADB="/path/to/your/sdk/platform-tools" to correct path. Two ways from here: 3 a> Run as "sh restartAdbOnFedoraAsRoot.sh". 4 a> Put your root password. You also can add executabl…
#!/bin/bash
# Copyright 2014 Ademar Alves de Oliveira <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,