Skip to content

Instantly share code, notes, and snippets.

View brianguertin's full-sized avatar

Brian brianguertin

View GitHub Profile
@brianguertin
brianguertin / data-uri.txt
Last active June 24, 2024 08:48
PDF data URI
data:application/pdf;base64,JVBERi0xLjMNCiXi48/TDQoNCjEgMCBvYmoNCjw8DQovVHlwZSAvQ2F0YWxvZw0KL091dGxpbmVzIDIgMCBSDQovUGFnZXMgMyAwIFINCj4+DQplbmRvYmoNCg0KMiAwIG9iag0KPDwNCi9UeXBlIC9PdXRsaW5lcw0KL0NvdW50IDANCj4+DQplbmRvYmoNCg0KMyAwIG9iag0KPDwNCi9UeXBlIC9QYWdlcw0KL0NvdW50IDINCi9LaWRzIFsgNCAwIFIgNiAwIFIgXSANCj4+DQplbmRvYmoNCg0KNCAwIG9iag0KPDwNCi9UeXBlIC9QYWdlDQovUGFyZW50IDMgMCBSDQovUmVzb3VyY2VzIDw8DQovRm9udCA8PA0KL0YxIDkgMCBSIA0KPj4NCi9Qcm9jU2V0IDggMCBSDQo+Pg0KL01lZGlhQm94IFswIDAgNjEyLjAwMDAgNzkyLjAwMDBdDQovQ29udGVudHMgNSAwIFINCj4+DQplbmRvYmoNCg0KNSAwIG9iag0KPDwgL0xlbmd0aCAxMDc0ID4+DQpzdHJlYW0NCjIgSg0KQlQNCjAgMCAwIHJnDQovRjEgMDAyNyBUZg0KNTcuMzc1MCA3MjIuMjgwMCBUZA0KKCBBIFNpbXBsZSBQREYgRmlsZSApIFRqDQpFVA0KQlQNCi9GMSAwMDEwIFRmDQo2OS4yNTAwIDY4OC42MDgwIFRkDQooIFRoaXMgaXMgYSBzbWFsbCBkZW1vbnN0cmF0aW9uIC5wZGYgZmlsZSAtICkgVGoNCkVUDQpCVA0KL0YxIDAwMTAgVGYNCjY5LjI1MDAgNjY0LjcwNDAgVGQNCigganVzdCBmb3IgdXNlIGluIHRoZSBWaXJ0dWFsIE1lY2hhbmljcyB0dXRvcmlhbHMuIE1vcmUgdGV4dC4gQW5kIG1vcmUgKSBUag0KRVQNCkJUDQovRjEgMDAxMCBUZg0KNjkuMjUwMCA2

Keybase proof

I hereby claim:

  • I am brianguertin on github.
  • I am brianguertin (https://keybase.io/brianguertin) on keybase.
  • I have a public key ASDuAoww-czUVoUJCUABYm1VrMLWHnwuaYE1I4Cnr2Z5lAo

To claim this, I am signing this object:

@brianguertin
brianguertin / Example.java
Last active August 24, 2017 20:32 — forked from anonymous/KYkY-1.java
Breadth-first tree traversal with Queue
import java.util.*;
public class Main {
private static class Node {
public final char value;
public final Node left;
public final Node right;
public Node(char value, Node left, Node right) {
I received this text in an email:
"Google came from nowhere and bullied themselves into a superpower by stealing" - © Ben Ligeri
To which I responded with this question:
"No, everyone using their services has volunteered to do so. What have they done that constitutes stealing?"
@brianguertin
brianguertin / Version.java
Created July 8, 2016 16:09
Simple SemVer version parsing and comparison in Java
public class Version implements Comparable<Version> {
@NonNull
public final int[] numbers;
public Version(@NonNull String version) {
final String split[] = version.split("\\-")[0].split("\\.");
numbers = new int[split.length];
for (int i = 0; i < split.length; i++) {
numbers[i] = Integer.valueOf(split[i]);
}
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:colorControlHighlight">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<corners android:radius="@dimen/button_radius" />
<solid android:color="@android:color/white" />
</shape>
</item>
</ripple>
@brianguertin
brianguertin / build.gradle
Created August 26, 2015 13:00
Automatically set Android versionName and versionCode from git commits, tags, and branch names
def getVersionCode = { ->
try {
def code = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', 'HEAD', '--count'
standardOutput = code
}
return code.toString().trim().toInteger()
}
catch (ignored) {