Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Cody Johnston pcj

View GitHub Profile
@pcj
pcj / WORKSPACE
Last active Sep 19, 2018
Loading io_grpc_grpc_java and rules_closure together without initial conflict.
View WORKSPACE
http_archive(
name = "io_grpc_grpc_java",
urls = ["https://github.com/grpc/grpc-java/archive/v1.15.0.tar.gz"],
strip_prefix = "grpc-java-1.15.0",
sha256 = "8a131e773b1c9c0442e606b7fc85d7fc6739659281589d01bd917ceda218a1c7",
)
load("@//:buildozer_http_archive.bzl", "buildozer_http_archive")
View init.el
;; Javascript macros
(fset 'javascript-jsdoc-comment
[?\C-a ?/ ?* ?* return ?* tab return ?* tab ?/ return up up ?\C-e ? ])
(fset 'javascript-jsdoc-param
[?\C-e ? ?@ ?p ?a ?r ?a ?m company-dummy-event ? ?\{ right ? ?k ? ?- ? ?d ?. left left left left left left left left])
(fset 'javascript-jsdoc-param-string
[return tab ?* ? ?@ ?p ?a ?r ?a ?m ? ?\{ ?s ?t ?r ?i ?n ?g company-dummy-event right ? ])
@pcj
pcj / README.md
Last active Oct 27, 2018
Installing bazel 0.4.5 on Windows
View README.md

Installing bazel 0.4.5 on Windows 10

  1. Read the steps in https://bazel.build/versions/master/docs/windows.html.
  2. Read the github issues https://github.com/bazelbuild/bazel/issues/2431 and related https://github.com/bazelbuild/bazel/issues/2449.
  3. May be useful to consult https://github.com/bazelbuild/bazel/blob/master/tools/cpp/cc_configure.bzl.

Install Msys2

  1. Make sure you install the Feb 5 2016 Msys2 version from https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-x86_64-20160205.exe/download.
  2. The install path must be c:\tools\msys64 (hardcoded into bazel).
@pcj
pcj / SumArray.java
Last active Nov 17, 2016
Dynamic Programming Problem
View SumArray.java
/**
* SumArray. Given an input list of integers 'A' with length N,
* calculate a NxN matrix 'B' such that the value of a cell B(i,j) is the
* sum of A(i)..A(j) forall i<=j.
*/
public class SumArray {
public static void main(String[] args) {
int[] a = new int[]{ 12, 3, 6, 2, 23, 44 };
int[][] b = makeArray(a);
@pcj
pcj / BUILD.py
Created Aug 4, 2016
Possible approach to extensibility of rules_protobuf
View BUILD.py
# Later, invoke the protobuf_go_library with the language flag. This will
# trigger building of the protobuffer with the grpc-gateway plugin and
# building of the library with the required dependencies.
load("@org_pubref_rules_protobuf//bzl:rules.bzl", "protobuf_go_library")
protobuf_go_library(
protos = ["service.proto"],
srcs = ["service_impl.go"],
@pcj
pcj / Makefile
Last active Aug 29, 2015
CrossRef API output
View Makefile
get_api:
curl -X GET -H "Content-Type: application/json" http://api.crossref.org/works/10.1148/radiology.206.3.9494508 | python -m json.tool
get_dx:
curl -LH "Accept: application/citeproc+json" http://dx.doi.org/10.1148/radiology.206.3.9494508 | python -m json.tool
@pcj
pcj / Makefile
Last active Aug 29, 2015
Testing CometD in mocha/node.js environment
View Makefile
npm_install:
npm install -g node-gyp
# jsdom must be installed at 3.x; the 4.x versions only run in io.js now.
npm install jsdom@3.1.2
npm install ws jquery-deferred nclosure
mocha_test:
mocha --harmony --recursive --timeout 20000 --reporter spec src/main/js/spec
View gist:afe70a9405129a2ce1d5
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-*color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
View gist:80d386355163b9a772c0
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-*color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
View README.md

This example shows how it is possible to use a D3 sunburst visualization (partition layout) with data that describes subgroups of patients.

It is covered by the Apache license:

Copyright 2013 Google Inc. All Rights Reserved.

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

You can’t perform that action at this time.