Skip to content

Instantly share code, notes, and snippets.

Avatar

Juan Benet jbenet

View GitHub Profile
@jbenet
jbenet / simple-git-branching-model.md
Last active Jan 8, 2022
a simple git branching model
View simple-git-branching-model.md

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@jbenet
jbenet / tikz2svg
Last active Jul 16, 2021
tikz2svg - convert tikz input into svg
View tikz2svg
#!/usr/bin/env python
#
# author: github.com/jbenet
# license: MIT
#
# tikz2svg: convert tikz input into svg
# depends on:
# - pdflatex: comes with your tex dist
# - pdf2svg: brew install pdf2svg
@jbenet
jbenet / fast-rd.md
Last active Jun 29, 2021
Fast Research & Development
View fast-rd.md

Fast Research & Development

People tend to believe that R&D takes a long time.

@jbenet
jbenet / filsend.md
Last active Jun 18, 2021
Sending a tx in filecoin w/ extra data
View filsend.md

Messages in Filecoin allow sending arbitrary values through the params field.

Encoding data into params

  • data to send through transactions should be base64 encoded when using the message sending APIs.
  • note: you'll be sending to method: 0, which should be the default in your tools. method: 0 will ignore the params.

lotus-shed example

@jbenet
jbenet / current_utc_time.c
Created Jul 17, 2011
work around lack of clock_gettime in os x
View current_utc_time.c
/*
author: jbenet
os x, compile with: gcc -o testo test.c
linux, compile with: gcc -o testo test.c -lrt
*/
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
View main.go
// Package main demonstrates a problem with sockets.
// run it with:
//
// go build
// ./test 127.0.0.1:1234
//
// Nevermind, found the problem (using select wrong)
//
package main
View peter-thiels-cs183-startup-class-01-notes-essay.md

Peter Thiel's CS183: Startup - Class 1 Notes Essay

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

View emacs-ox-hugo.el
#!/usr/bin/env emacs -Q --script
;; Sandbox
(setq
user-emacs-directory (concat (file-name-directory load-file-name) ".emacs/")
package-user-dir (concat user-emacs-directory "elpa/")
use-package-always-ensure t
inhibit-message t) ; if there are errors, remove this.
; debug-on-error t) ; if there are errors, add this.
View sftp-user-notes.md

sftp user

So you want to configure an sftp only user?

Setup a group for sftp only users

groupadd sftponly

Make chroot jail directory

@jbenet
jbenet / large-docs-comments.css
Last active Feb 4, 2019
Large google docs comments
View large-docs-comments.css
/*
large google docs comments
add this to a user stylesheet
like https://github.com/openstyles/stylus
*/
/* make comment boxes large */
@media only screen and (min-width: 1400px) {
.docos-layout-anchored
.docos-anchoreddocoview {