Skip to content

Instantly share code, notes, and snippets.

Avatar
🇧🇷

Arthur Oliveira de Melo tucomel

🇧🇷
View GitHub Profile
@tucomel
tucomel / themeToggler.applescript
Last active Jul 18, 2020
MacOS applescript smoothly dark mode toggle
View themeToggler.applescript
(* based on https://gist.github.com/davedelong/850409c512ab2d2a21aa6fa690096d56 *)
on setDarkModeSmothly(shouldBeDark)
tell application "System Events"
if dark mode of appearance preferences is shouldBeDark then
return "no changes"
end if
end tell
if shouldBeDark then
set mode to "dark"
View NumberView.java
public class NumberView extends View {
private final Interpolator mInterpolator;
private final Paint mPaint;
private final Path mPath;
// Numbers currently shown.
private int mCurrent = 0;
private int mNext = 1;
@tucomel
tucomel / macOS links.md
Last active Feb 25, 2019
macOS links that apple removed from apple store
View macOS links.md
View Utilities.java
/**
* @param str String with special caracters
* @return double value of string
*/
public static double toDouble(String str) {
str = str.replaceAll("[^\\d]", "");
if (str != null && str.length() > 0) {
return Double.parseDouble(str) / 100;
} else {
return 0;
@tucomel
tucomel / MoneyTextWatcher.java
Last active Oct 9, 2018
MoneyTextWatcher Android
View MoneyTextWatcher.java
public class MoneyTextWatcher extends METValidator implements TextWatcher, View.OnFocusChangeListener {
public static final String T = "MoneyTextWatcher";
protected int max_length = Integer.MAX_VALUE;
private EditText editText;
private View linkedText;
private String formatType;
private String current = "";
private boolean insertingSelected = false;
private boolean isDeleting;
private MoneyTextDelegate delegate;