Skip to content

Instantly share code, notes, and snippets.

View chgibb's full-sized avatar

Chris Gibb chgibb

  • Apple
  • Cupertino
View GitHub Profile
@chgibb
chgibb / Find Merge Commits for Sha
Created September 17, 2021 19:21
Finds Merge Commits Where the Given Sha is an Ancestor
git log <sha>..HEAD --ancestry-path --merges --oneline --color | tail -n 10
@chgibb
chgibb / main.dart
Last active September 1, 2021 12:33
Conflicting Hashcodes
class MyClass {
final String field1;
final String field2;
MyClass(this.field1, this.field2);
@override
int get hashCode => runtimeType.hashCode ^ field1.hashCode ^ field2.hashCode;
@override
@chgibb
chgibb / main.dart
Created August 6, 2021 16:06
Dart Rethrow
void main() {
try {
try {
throw 1;
} catch (e, s) {
print("$e $s");
rethrow;
}
} catch (e2, s2) {
print("$e2 $s2");
@chgibb
chgibb / Base64.h
Created April 7, 2019 15:38 — forked from tomykaira/Base64.h
C++ single header base64 decode/encoder.
#ifndef _MACARON_BASE64_H_
#define _MACARON_BASE64_H_
/**
* The MIT License (MIT)
* Copyright (c) 2016 tomykaira
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including