Skip to content

Instantly share code, notes, and snippets.


Arthur Oliveira de Melo tucomel

View GitHub Profile
tucomel / themeToggler.applescript
Last active Jul 18, 2020
MacOS applescript smoothly dark mode toggle
View themeToggler.applescript
(* based on *)
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"
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 / macOS
Last active Feb 25, 2019
macOS links that apple removed from apple store
View macOS
* @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 /
Last active Oct 9, 2018
MoneyTextWatcher Android
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;