Skip to content

Instantly share code, notes, and snippets.

@jnavila
jnavila / set-priority
Last active August 22, 2019 17:35
pythonesque version
#!/usr/bin/python3
import polib
import sys
SECTIONS = {300: ["en/git-init.txt",
"en/git-clone.txt",
"en/urls.txt",
"en/git-add.txt"],
280: ["en/git-status.txt",
$ opam install git-unix
The following actions will be performed:
∗ install git-http 2.0.0 [required by git-unix]
∗ install git-unix 2.0.0
===== ∗ 2 =====
Do you want to continue ? [Y/n] y
=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The sources of the following couldn't be obtained, aborting:
- git-http.2.0.0
@jnavila
jnavila / git-grep-histo
Created May 25, 2012 09:29
Grep in git history made parallel
#!/bin/sh
git rev-list --all | xargs --max-args=1 --max-procs=4 git grep $@
@jnavila
jnavila / Explanation.md
Created May 6, 2012 17:57
Digging in githubarchive for forks and pull requests

Rationale

Github makes it easy to start participating to a project. The recommended way of doing this is just fork, push your changes and send a pull request to the origin project. So the question is now, how are projects using this workflow, and which projects are relying on it.

Note: all along, I use a kernel of query to extract pull requests related to forks. The request is limited to one month to keep it under the size limit. As an added bonus, the query provides the average latency between fork and pull-request.

Projects using the fork to pull paradigm

The query named Fork2PullRequestByProject.sql helps sort out the greatest projects using of this feature over the month of april:

@jnavila
jnavila / test.c
Created April 12, 2012 22:30
preprocessor macro that returns 1 if macro is set to 1, else 0
#define dummy_macro(...)
#define CONFIG_1 )(1
#define is_set(macro) is_set1(macro)
#define is_set1(macro) is_set2(CONFIG_##macro)
#define is_set2(x) (dummy_macro( x ) +0)
#define FOO 1
is_set(FOO)