Skip to content

Instantly share code, notes, and snippets.

@eldstal
eldstal / Makefile
Last active November 2, 2017 13:47
Numpy C++ module
all: nativemodule.so
%.so: %.cpp
g++ -ggdb -std=c++11 -shared -I/usr/include/python2.7 -lpython2.7 -fPIC -o $@ $<
run: nativemodule.so
./run.py
#!/bin/sh
#
# Generates version.h in all app_* directories
# If filenames are supplied on the command line, create those instead.
# If a directory is supplied on the command line, output the version of that directory
# Determine if git can provide a sensible version string
have_version() {
git describe >/dev/null 2>&1 && return 0
return 1
% First, put the curves in place
[AX, H1, H2] = plotyy(N_mark_resolve, D_N_mark_resolve, N_mark_noresolve, D_N_mark_noresolve, 'plot');
set(H1, 'LineStyle', ('-'));
set(H1, 'LineWidth', 2);
set(H1, 'Color', 'g');
set(H2, 'LineStyle', ('--'));
set(H2, 'LineWidth', 2);
set(H2, 'Color', 'k');
set(AX(1), 'YColor', 'k')
@eldstal
eldstal / bot.sh
Created October 30, 2012 09:07
A simple IRC bot. Join, spam, disconnect.
#!/bin/bash
# $1: The nickname to use
function ircpreamble {
echo "NICK ${1}"
echo "USER ${1} 0 * :Totally not a spambot"
}
# $1: Channel to join
function channel {