Skip to content

Instantly share code, notes, and snippets.

View bobsomers's full-sized avatar

Bob Somers bobsomers

View GitHub Profile
@bobsomers
bobsomers / README.md
Last active September 2, 2022 05:09
How to Install YouCompleteMe on Apple Silicon (M1 Mac) with C++ and Rust Completion

How to Install YouCompleteMe on Apple Silicon (M1 Mac) with C++ and Rust Completion

First, install native MacVim, Python, and LLVM:

arch -arm64 brew install llvm python macvim

Add configuration in your .vimrc to use Homebrew LLVM's clangd for C++ completion.

@bobsomers
bobsomers / custom_sort.cpp
Created August 23, 2018 17:43
Example of using a custom sorting predicate function in C++
struct Interval {
int start;
int end;
Interval() : start(0), end(0) {}
Interval(int s, int e) : start(s), end(e) {}
};
// Must return true if the first argument (a) should appear before the second argument (b).
bool interval_by_start(const Interval& a, const Interval& b) {
return a.start < b.start;
@bobsomers
bobsomers / keybase.md
Created October 8, 2016 06:07
Keybase Proof

Keybase proof

I hereby claim:

  • I am bobsomers on github.
  • I am bobsomers (https://keybase.io/bobsomers) on keybase.
  • I have a public key whose fingerprint is 251E 08D2 9A5B 3A96 A75F 359C 8DCC 7198 75B9 90CB

To claim this, I am signing this object:

@bobsomers
bobsomers / arch-linode-fde.md
Last active August 30, 2019 04:29
Arch Linux on Linode with Full Disk Encryption
@bobsomers
bobsomers / PKGBUILD
Created January 26, 2012 03:26
Updated PKGBUILD for pycuda-2011.2.2
# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>
pkgname=pycuda
pkgver=2011.2.2
pkgrel=2
pkgdesc="Python wrapper for Nvidia CUDA"
arch=('i686' 'x86_64')
url="http://mathema.tician.de/software/pycuda"
license=('MIT/X Consortium')
source=(http://pypi.python.org/packages/source/p/pycuda/${pkgname}-${pkgver}.tar.gz)
depends=('cuda-toolkit' 'python2-numpy' 'python2-pytools' 'python2')
@bobsomers
bobsomers / gist:1451131
Created December 9, 2011 11:08
Biogpu example with arbitrary ranges.
import biogpu.correlation
# Pyroprints are defined as a list of lists. Each inner list is just a list of
# each dispensation value. Note that both sets of pyroprints you're comparing
# should have the same length for all their inner lists (i.e. they're all 104
# dispensations long. These are 32-bit floating point values.
# Here's a set of 3 pyroprints each with 3 dispensations.
A = [[1.0, 2.0, 3.0], # first pyroprint
[4.0, 5.0, 6.0], # second pyroprint