Skip to content

Instantly share code, notes, and snippets.

Justine Tunney jart

Block or report user

Report or block jart

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jart
jart / .bashrc
Last active Oct 6, 2017
TensorBoard Profiling Script
View .bashrc
# pip install yappi
# tensorboard-profile-wall-time --logdir=/google/data/ro/users/ja/jart/tensorboard/userlogdirs/1
tensorboard-profile-wall-time() {
-tensorboard-profile wall "$@"
}
tensorboard-profile-cpu-time() {
-tensorboard-profile cpu "$@"
}
@jart
jart / .bashrc.npm.sh
Last active Mar 1, 2019
NPM Dependency Calculator
View .bashrc.npm.sh
# NPM Dependency Calculator
#
# Author: Justine Tunney <jart@google.com>
# Last Updated: 2016-09-22
#
# This is a .bashrc addition that lets you inspect the transitive closure of
# dependencies for an NPM package. It does not require NPM or node.js to be
# installed on your system. It takes into consideration the fact that NPM
# does not resolve diamond dependencies. It goes super fast.
#
@jart
jart / bazel-maven-repo-name.js
Last active Jan 16, 2017
Bazel Maven Repository Naming Algorithm
View bazel-maven-repo-name.js
/**
* @fileoverview Bazel external repository naming algorithm for Maven.
*/
var CLEANSE_CHARS_ = new RegExp('[^_0-9A-Za-z]', 'g');
/**
* Turns Maven group and artifact into Bazel repository name.
*
* <p>This algorithm works by turning illegal characters into underscores and
@jart
jart / java_import_external.bzl
Last active Jan 16, 2017
Bazel Java External Library Rule
View java_import_external.bzl
# Copyright 2016 The Closure Rules Authors. 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@jart
jart / nasm.BUILD.py
Last active Nov 12, 2016
NASM build file
View nasm.BUILD.py
# http://www.nasm.us/pub/nasm/releasebuilds/2.12.02/nasm-2.12.02.tar.bz2
licenses(["notice"]) # As of v2.07, nasm is licensed under the 2-clause BSD license.
cc_binary(
name = "nasm",
srcs = [
"assemble.c",
"crc64.c",
"directiv.c",
@jart
jart / fastio.py
Created Oct 23, 2016
Multithreaded Python os.walk
View fastio.py
# Copyright 2016 The TensorFlow Authors. 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@jart
jart / BUILD
Created Oct 17, 2016
SWIG Bazel BUILD
View BUILD
licenses(["restricted"]) # GPLv3
exports_files(["LICENSE"])
cc_binary(
name = "swig",
srcs = [
"Source/CParse/cparse.h",
"Source/CParse/cscanner.c",
"Source/CParse/parser.c",
@jart
jart / npm.bashrc.sh
Last active Oct 11, 2016
NPM Transitive Deps Calculator
View npm.bashrc.sh
# NPM Dependency Calculator
#
# Author: Justine Tunney <jart@google.com>
# Copyright 2016 Google Inc. All Rights Reserved.
# Licensed under the Apache 2.0 license
# Last Updated on 2016-09-22
#
# This is a .bashrc addition that lets you inspect the transitive closure of
# dependencies for an NPM package. It does not require NPM or node.js to be
# installed on your system. It takes into consideration the fact that NPM
@jart
jart / gzip-benchmark.py
Created Aug 11, 2016
Python GZip Benchmark
View gzip-benchmark.py
#!/usr/bin/env python
#
# tl;dr: compresslevel=1 is 4x faster than the default and nearly as good
#
# https://docs.python.org/2/library/gzip.html
#
# http11 jart@compy://third_party/tensorflow/tensorboard$ python ~/doodle.py
# 1 5% 151ms
# 2 4% 149ms
# 3 4% 143ms
View GenTestRules.bzl
# -*- mode:python; -*-
#
# Copyright 2016 The Bazel Authors. 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
You can’t perform that action at this time.