Skip to content

Instantly share code, notes, and snippets.

View bhamiltoncx's full-sized avatar

Ben Hamilton (Ben Gertzfield) bhamiltoncx

View GitHub Profile
% git clone https://gerrit.googlesource.com/gerrit
% cd gerrit
% git fetch https://gerrit.googlesource.com/gerrit refs/changes/84/72684/3 && git checkout FETCH_HEAD
% rm -f buck-out/log/buck*.log; buck clean && rm -rf buck-out eclipse-out && buck build gerrit-common:server
Buck does not appear to have been built -- building Buck!
All done, continuing with build.
Using watchman.
No Android platform target specified. Using default: Google Inc.:Google APIs:21
Download http://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar
@bhamiltoncx
bhamiltoncx / chromium-mach-shared-memory.patch
Created November 4, 2015 16:09
Performance patch to always use Mach shared memory on OS X instead of POSIX wrapper
diff --git a/base/memory/shared_memory_mac.cc b/base/memory/shared_memory_mac.cc
index 8f198dc..9f966c8 100644
--- a/base/memory/shared_memory_mac.cc
+++ b/base/memory/shared_memory_mac.cc
@@ -32,6 +32,7 @@ namespace base {
namespace {
+#if 0
const char kTrialName[] = "MacMemoryMechanism";
@bhamiltoncx
bhamiltoncx / gist:044d3c91e7640f50f998
Created October 21, 2015 19:43
Chromium perf issue with shared memory
Running Time Self (ms) Symbol Name
8596.0ms 64.7% 0.0 base::Thread::ThreadMain 0x33e79
8563.0ms 64.4% 0.0 thread_start
8563.0ms 64.4% 0.0 _pthread_start
8563.0ms 64.4% 0.0 _pthread_body
8563.0ms 64.4% 0.0 base::(anonymous namespace)::ThreadFunc(void*)
8563.0ms 64.4% 0.0 base::Thread::ThreadMain()
8563.0ms 64.4% 0.0 content::BrowserThreadImpl::Run(base::MessageLoop*)
8563.0ms 64.4% 0.0 content::BrowserThreadImpl::IOThreadRun(base::MessageLoop*)
8563.0ms 64.4% 0.0 base::Thread::Run(base::MessageLoop*)
@bhamiltoncx
bhamiltoncx / example.swift
Last active December 16, 2020 16:50
Compiling Swift and Objective-C from the Command-Line
% ls -l
total 40
-rw-r--r--@ 1 bhamiltoncx staff 111 Sep 26 14:42 ObjcGreeter.h
-rw-r--r--@ 1 bhamiltoncx staff 155 Sep 26 14:50 ObjcGreeter.m
-rw-r--r-- 1 bhamiltoncx staff 300 Sep 26 15:06 greetings.swift
-rw-r--r-- 1 bhamiltoncx staff 304 Sep 26 15:06 input.swift
-rw-r--r-- 1 bhamiltoncx staff 165 Sep 26 15:06 main.swift
% cat greetings.swift
import Foundation
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.kframework.backend.java.kil.BuiltinListTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.218 sec - in org.kframework.backend.java.kil.BuiltinListTest
Running org.kframework.backend.java.kil.BuiltinMapTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.043 sec - in org.kframework.backend.java.kil.BuiltinMapTest
Running org.kframework.backend.java.kil.JavaSymbolicObjectTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.363 sec - in org.kframework.backend.java.kil.JavaSymbolicObjectTest
Running org.kframework.backend.java.builtins.BuiltinFloatOperationsTest
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.405 s
[INFO] Finished at: 2015-09-03T10:35:36-07:00
[INFO] Final Memory: 27M/312M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (default) on project nuprocess: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - /Users/bgertzfield/src/NuProcess/src/main/java/com/zaxxer/nuprocess/NuProcess.java:43: error: reference not found
[ERROR] * process is terminated by the {@link #destroy()} method, the exit code is non-deterministic.
% ls -l /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs
total 8
drwxrwxr-x 12 root wheel 408 Apr 14 13:36 iPhoneSimulator.sdk
lrwxr-xr-x 1 root wheel 19 Apr 14 13:34 iPhoneSimulator8.3.sdk -> iPhoneSimulator.sdk
% echo "int main() {}" > test.m
% clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk -mios-simulator-version-min=7.0 -o test test.m
% clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -mios-simulator-version-min=7.0 -o test8.3 test.m
% otool -l test | grep -A 3 LC_VERSION_MIN_IPHONEOS
cmd LC_VERSION_MIN_IPHONEOS
cmdsize 16
% PYTHONPATH=/tmp/path-to/third-party/py/pathlib /usr/bin/python2
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pathlib
>>> dir(pathlib)
['EINVAL', 'ENOENT', 'Path', 'PosixPath', 'PurePath', 'PurePosixPath', 'PureWindowsPath', 'S_ISBLK', 'S_ISCHR', 'S_ISDIR', 'S_ISFIFO', 'S_ISLNK', 'S_ISREG', 'S_ISSOCK', 'Sequence', 'WindowsPath', '_Accessor', '_Flavour', '_NormalAccessor', '_PathParents', '_PosixFlavour', '_PreciseSelector', '_RecursiveWildcardSelector', '_Selector', '_TerminatingSelector', '_WildcardSelector', '_WindowsFlavour', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_cached', '_is_wildcard_pattern', '_make_selector', '_normal_accessor', '_posix_flavour', '_py2', '_py2_fs_encoding', '_py2_fsencode', '_windows_flavour', 'attrgetter', 'basestring', 'contextmanager', 'fnmatch', 'functools', 'intern', 'io', 'nt', 'ntpath', 'os', 'posixpath',
% buck build buck
[snip]
generate-immutables:
[mkdir] Created dir: /path/to/devtools/buck/build/immutables
[javac] Compiling 56 source files
[javac]
[javac]
[javac] The system is out of resources.
Buildfile: /Users/bgertzfield/devtools/buck/build.xml
checkversion:
compile-testrunner:
compile-bootstrapper:
dx-check-build: