Skip to content

Instantly share code, notes, and snippets.

View candeira's full-sized avatar

Javier Candeira candeira

View GitHub Profile
@candeira
candeira / pr.md
Created March 25, 2013 21:46 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@candeira
candeira / above log 01.all.bash
Created July 12, 2014 02:37
Extempore 0.52 failing to build in Ubuntu 13.10 under linuxbrew
+ build/obj/AudioDevice.o src/AudioDevice.cpp
+ build/obj/EXTCondition.o src/EXTCondition.cpp
+ build/obj/Extempore.o src/Extempore.cpp
+ build/obj/EXTLLVM.o src/EXTLLVM.cpp
+ build/obj/EXTMonitor.o src/EXTMonitor.cpp
+ build/obj/EXTMutex.o src/EXTMutex.cpp
+ build/obj/EXTThread.o src/EXTThread.cpp
+ build/obj/OSC.o src/OSC.cpp
+ build/obj/Scheme.o src/Scheme.cpp
+ build/obj/SchemeFFI.o src/SchemeFFI.cpp
@candeira
candeira / gist:9e9c3f5276bd929eeb3d
Created July 13, 2014 02:16
Bug compiling the xtmmath part of the standard library
kandinski@desire:~/data/work/hack/llvm-3.4.2.src/build/bin$ ls
bugpoint llvm-bcanalyzer llvm-extract llvm-ranlib llvm-tblgen
llc llvm-config llvm-link llvm-readobj macho-dump
lli llvm-cov llvm-mc llvm-rtdyld opt
lli-child-target llvm-diff llvm-mcmarkup llvm-size
llvm-ar llvm-dis llvm-nm llvm-stress
llvm-as llvm-dwarfdump llvm-objdump llvm-symbolizer
kandinski@desire:~/data/work/hack/llvm-3.4.2.src/build/bin$ export EXT_LLVM_DIR=~/data/work/hack/llvm-3.4.2.src/build
@candeira
candeira / README.md
Last active August 29, 2015 14:07 — forked from anonymous/README.md

Part 1

Proof of concept

Say, you want to save your D3 application in a CouchDB database. This is just a proof of concept that this is possible. I use the »Focus + Context« diagram by Mike Bostock (http://bl.ocks.org/1667367) as an example.

Prerequisites:

@candeira
candeira / ipython caches libraries
Created October 26, 2014 05:51
Does iPython cache older versions of libraries?
# using ipython 1.2.1 on Ubuntu 14.04
# I have a cloudant-python library installed in a virtualenv
# there was a bug, which I fixed, and ipython-notebook kept
# showing the old behaviour. ipython in the console also shows
# the old behaviour:
$ ipython
WARNING: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
@candeira
candeira / git-deadbranches
Created January 22, 2015 01:23
git deadbranches command deletes all local and remote branches merged into develop
#!/usr/bin/env bash
git checkout develop || (echo "Aborting..." && exit 1)
git pull || (echo "Aborting..." && exit 1)
BRANCHES=$(git branch --merged | grep -v develop | grep -v master | tr -d "\n")
for BRANCH in $BRANCHES
do
@candeira
candeira / spinlock-macro.h
Last active August 29, 2015 14:14
Attempting to macro-ize gallir's spinlock
// macro-ize gallir's spinlock code from:
// http://stackoverflow.com/questions/6704252/atomic-memcpy-suggestion/28286503#28286503
// third version, thanks to kragen for explains of expression/statement and do/while protective coding
#define SPINLOCK(lock) do { while ((lock) || ! __sync_bool_compare_and_swap(&(lock) , 0 , 1));} while (0)
#define SPINUNLOCK(lock) (lock) = 0;
// and the wrap-a-block version
@candeira
candeira / example-subtree-usage.md
Created August 18, 2017 07:12 — forked from kvnsmth/example-subtree-usage.md
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add git@github.com:AFNetworking/AFNetworking.git Vendor/AFNetworking

or something to that effect.

@candeira
candeira / sc3-plugins.nix
Created October 9, 2019 04:17 — forked from gosub/sc3-plugins.nix
Nix package definition for sc3-plugins
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "sc3-plugins-3.7.0-beta";
src = fetchgit {
url = "https://github.com/supercollider/sc3-plugins";
rev = "a963ecb";
sha256="0840jwh7ljmhg34zblahqx3abk42a3y3gvgb740r558rphbp1p19";
fetchSubmodules = true;
@candeira
candeira / encryptedNixos.md
Created May 16, 2020 05:47 — forked from ladinu/encryptedNixos.md
NixOS install with encrypted /boot /root with single password unlock

Requirements

  1. Encrypt everthing including /boot and /root
  2. Enter password once
  3. Support UEFI

Installation media setup

Download NixOS minimal iso and copy to USB stick. For example on Mac OSX

$ diskutil list
$ diskutil unmountDisk /dev/disk1 # Make sure you got right device