Skip to content

Instantly share code, notes, and snippets.

View jbenet's full-sized avatar

Juan Benet jbenet

View GitHub Profile
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

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 / current_utc_time.c
Created July 17, 2011 16:17
work around lack of clock_gettime in os x
/*
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>
@jbenet
jbenet / gist:8f000606f2009495c56177f6ca2c19b7
Last active February 13, 2023 02:29
some notes on ideas

When people come up with ideas, they often assume that:

  • coming up with an idea is the same thing as coming up with an idea first (it isn't, read existing literature)
  • coming up with an idea first is dramatically more special than coming up with an idea (it isn't)
  • the wealth of existing literature does not include their idea (almost always it does)
  • unpublished ideas do not count (they do, lots of important discoveries happen verbally, and unfortunately sometimes only verbally :( )
  • coming up with it first is more important than fleshing out a body of work (it isn't)

And these assumptions tend to make people very unhappy. I repeatedly see people succumbing to sadness over multiple discovery. It shouldn't be sad, it should be a happy event, as it confirms our thoughts and presents an opportunity for collaborations.

@jbenet
jbenet / tikz2svg
Last active November 30, 2022 04:34
tikz2svg - convert tikz input into svg
#!/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 / ipfs-archive
Created January 7, 2018 21:49
ipfs-archive shell script for adding files, urls, stdin and pinning
#!/bin/bash
# install into your path, as 'ipfs-archive', 'static' or something like that
# OPTIONS
# use this ipfs api
# this is an ipfs cluster for me :)
ipfsApi="/ip4/127.0.0.1/tcp/9095"
# gateway URLs. for printing, and automatic open
@jbenet
jbenet / readme.md
Created August 4, 2022 20:08
Iceland Eruption
// 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
@jbenet
jbenet / fast-rd.md
Last active June 29, 2021 08:21
Fast Research & Development

Fast Research & Development

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

@jbenet
jbenet / filsend.md
Last active June 18, 2021 10:29
Sending a tx in filecoin w/ extra data

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