Skip to content

Instantly share code, notes, and snippets.

View tooolbox's full-sized avatar

Matt Mc tooolbox

  • Non-Profit
  • Los Angeles, California
View GitHub Profile
@tooolbox
tooolbox / protobuf.md
Last active September 28, 2019 18:26
The protobuf documentation you wish you had when you started

Generally: protoc -flag param:param:param target-file.proto --plugin_flag=key=value,key=value:./dest/

For example: protoc -I .:.. foo.proto --go_out=plugins=grpc,paths=source_relative:.

This means:

  1. Run protoc on foo.proto
  2. Any other proto files in the current directory or the parent directory should be available for import.
  3. Generate a foo.pb.go file for gRPC using protoc-gen-go.

Software Proverbs

  • Clear is better than clever. --Rob Pike
  • Software engineering is what happens to programming when you add time and other programmers. --Russ Cox
  • Programs must be written for people to read, and only incidentally for machines to execute. --Hal Abelson and Gerald Sussman
  • The most important skill for a programmer is the ability to effectively communicate ideas. --Gaston Jorquera
  • Design is the art of arranging code to work today, and be changeable forever. --Sandi Metz
  • If it’s a core business function — do it yourself, no matter what. --Joel Spolsky
  • Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it --Brian Kernighan
@tooolbox
tooolbox / CustomCell.swift
Created February 12, 2018 06:06 — forked from jasdev/CustomCell.swift
An approach to safer UITableViewCell and UICollectionViewCell reuse
class CustomCell: UITableViewCell, Reusable {
class var reuseIdentifier: String {
return "customCell"
}
}
class SupaHotCustomCell: CustomCell {
override class var reuseIdentifier: String {
return "supaHotCustomCell"
}
@tooolbox
tooolbox / kf7-css.js
Last active August 29, 2015 14:27
NodeJS for KF7 CSS Processing
#!/usr/bin/env node
// The above "shebang" tells the bash terminal to run this script as a Node.js script.
// Import NodeJS packages
var argv = require('yargs').argv; // for processing command-line arguments
var fs = require("fs"); // filesystem
var wrench = require('wrench'); // for deep recursive copying
var css = require('css'); // for parsing CSS into an AST
var walk = require('rework-walk'); // for walking ASTs generated by the css module
var cheerio = require('cheerio'); // jquery-like access to an HTML document