Read the related article on Medium.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function type(p) { | |
return Object.prototype.toString.call(p) | |
.match(/\[object (.*)\]/)[1]; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rev-list --max-parents=0 HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Build; | |
import java.lang.reflect.Method; | |
public class Device { | |
/** | |
* @return The device's serial number, visible to the user in {@code Settings > About phone/tablet/device > Status | |
* > Serial number}, or {@code null} if the serial number couldn't be found | |
*/ | |
public static String getSerialNumber() { |
See the related Medium article for more info and a GIF showing the final result.
Given this function :
function testFn(a1, a2) {
if (a1)
if (a2)
return 'a1 && a2';
else
return 'else';
}