Skip to content

Instantly share code, notes, and snippets.

@nfoti
nfoti / basic.py
Created July 25, 2012 00:33
Cythonize instance method of Python class
import numpy as np
from scipy.special import gammaln
class MyClass(object):
def __init__(self, n, x):
self.n = n
self.x = np.abs(x)
def fun(self):
@nfoti
nfoti / vim.rb
Last active December 10, 2015 17:58 — forked from uasi/vim.rb
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
version '7.3.762'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
@nfoti
nfoti / eigen_rowwise.cpp
Last active August 29, 2015 14:09
Eigen broadcasting example
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
ArrayXXd A(2,4);
import os.path as op
import numpy as np
import mne
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator, apply_inverse
from mne.simulation import simulate_stc, simulate_evoked

Keybase proof

I hereby claim:

  • I am nfoti on github.
  • I am nfoti (https://keybase.io/nfoti) on keybase.
  • I have a public key ASAGnarw5Oa8nCG9FCDtjJslMPumH-iHV0w-EfF4NTDIZAo

To claim this, I am signing this object: