Skip to content

Instantly share code, notes, and snippets.

@jschaf
jschaf / BUILD
Last active April 16, 2017 08:56
Bazel Docker 64-byte repo name
load("@bazel_tools//tools/build_defs/docker:docker.bzl", "docker_build")
docker_build(
name = "hello",
base = "@official_ubuntu//image:image.tar",
cmd = ["echo", "hi"],
)
We couldn’t find that file to show.
package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_binary")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
# With the externs file as a source for the library
closure_js_library(
name = "foo",
srcs = [
"foo.js",
We couldn’t find that file to show.
@jschaf
jschaf / remove-open-search.user.js
Last active December 25, 2017 04:50
TamperMonkey script to prevent Chrome from auto-adding search engines.
// ==UserScript==
// @name RemoveOpenSearch
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Prevent Chrome from automatically adding search engines.
// @author Joe Schafer
// @match http://*/*
// @grant none
// ==/UserScript==
@jschaf
jschaf / index.js
Last active September 1, 2016 06:41
test
const ERROR = 2;
module.exports = {
extends: [],
parserOptions: {
ecmaVersion: 6,
sourceType: 'script',
},
@jschaf
jschaf / answers.txt
Created February 29, 2016 02:55
Generate combinations of numbers
50 4 - 6 75 - 100 + 25 * +
50 4 - 6 75 100 - - 25 * +
50 4 6 75 - 100 + 25 * - -
50 4 6 75 100 - - 25 * - -
75 4 - 6 50 100 25 - + * +
75 4 - 6 50 100 + 25 - * +
75 4 6 50 100 25 - + * - -
75 4 6 50 100 + 25 - * - -
50 4 75 6 100 + - 25 * + -
50 4 75 6 - 100 - 25 * + -
@jschaf
jschaf / lldb.py
Created November 12, 2015 08:49
Left Leaning Red Black Tree
class LLRB(object):
class Node(object):
RED = True
BLACK = False
__slots__ = ['value', 'left', 'right', 'color']
def __init__(self, value):
@jschaf
jschaf / Gruntfile.js
Last active August 29, 2015 14:09
Gruntfile.js Watch Task doesn't produce output
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
@jschaf
jschaf / Makefile
Last active August 29, 2015 14:03
pandoc-citeproc bibtex
INPUT = minimal.md
OUTPUT = minimal.pdf
TEMPLATE = template.tex
all:
pandoc \
--filter pandoc-citeproc \
--standalone \
--variable="linestretch=2" \
--template=$(TEMPLATE) \