Skip to content

Instantly share code, notes, and snippets.

View douglasdrumond's full-sized avatar
📷
brb

Douglas Drumond Kayama douglasdrumond

📷
brb
View GitHub Profile
<color name="sunshine_blue">#ff1ca8f4</color>
<color name="sunshine_blue">#ff1ca8f4</color>

Keybase proof

I hereby claim:

  • I am douglasdrumond on github.
  • I am douglasdrumond (https://keybase.io/douglasdrumond) on keybase.
  • I have a public key whose fingerprint is E37E 180E CC71 76C2 D2A5 76A5 A40F 4641 47FC C679

To claim this, I am signing this object:

@douglasdrumond
douglasdrumond / dex count
Created October 1, 2014 17:00
Count dex methods
function dex-method-count() {
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"'
}
function dex-method-count-by-package() {
dir=$(mktemp -d -t dex)
baksmali $1 -o $dir
for pkg in `find $dir/* -type d`; do
smali $pkg -o $pkg/classes.dex
count=$(dex-method-count $pkg/classes.dex)
name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.')

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@douglasdrumond
douglasdrumond / reduceBitmap
Last active February 11, 2018 13:07
Reduce a Bitmap on Android
// Disclaimer: this wasn't tested, it's just for teaching the way to a friend,
// maybe there are some bugs.
public void reduceBitmap(String sourcePath, String destinationPath) {
// Adjust width and height to your needs
int targetW = 800;
int targetH = 600;
// Get the dimensions of the bitmap
BitmapFactory.Options bmOptions = new BitmapFactory.Options();

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@douglasdrumond
douglasdrumond / update.sh
Created February 17, 2016 04:35 — forked from kaushikgopal/update.sh
My morning cli ritual
echo "y" | android update sdk --no-ui; echo "yes" | apm upgrade; softwareupdate -i -a; brew update; brew upgrade; brew cleanup; brew cask cleanup; npm update npm -g; npm update -g; gem update
@douglasdrumond
douglasdrumond / sobre trabalhar PJ
Last active March 11, 2016 12:38
Sobre trabalhar PJ (texto compartilhado na comunidade AndroidBrasilDev, não é de minha autoria)
Como você eu tive que pesquisar e entender o que significa trabalhar como PJ
para decidir sobre uma oportunidade.
Bom antes de entender o que significa trabalhar como PJ você deve entender
o que significa trabalhar como CLT e porque as empresas preferem evitar isso.
No CLT vc tem o seu salário bruto digamos que seja R$ 3000. Mas o que você
recebe de verdade é R$ 2603,83
O que acontece é que você tem que pagar do seu salário 11% de INSS R$ 330 mais