This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -u | |
# usage: | |
# | |
# $ git clone git://github.com/bjodah/chempy | |
# $ ./test_repo.sh chempy | |
if [[ $1 == */ ]]; then | |
>&2 echo "$1 ends with a slash" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8; mode: cython -*- | |
# distutils: language = c++ | |
cimport numpy as cnp | |
cnp.import_array() # Numpy C-API initialization | |
import numpy as np | |
cdef extern from "numpy/arrayobject.h": | |
void PyArray_CLEARFLAGS(cnp.ndarray, int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A simple script to backup an organization's GitHub repositories. | |
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos | |
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423 | |
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files | |
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up | |
# (if you're backing up a user's repos instead, this should be your GitHub username) | |
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8; mode: cython -*- | |
# distutils: language = c++ | |
from struct_ex cimport OutVectors | |
cdef class PyClass: | |
cdef OutVectors *thisptr | |
def __cinit__(self, int x=1, int y=1): | |
self.thisptr = new OutVectors(x, y) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "header.hpp" | |
#include <stdlib.h> | |
#include <vector> | |
using namespace std; | |
namespace ops { | |
Powers :: Powers() {} | |
Powers::~Powers() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# This file should work with both Python 2 & Python 3: | |
# | |
# $ python2 -m pytest enmako.py | |
# $ python3 -m pytest enmako.py | |
import io | |
import argh | |
from mako.template import Template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
import pprint | |
class Echo: | |
""" Context maganger for echoing variable assignments (in CPython) | |
Examples | |
-------- | |
>>> with Echo(): | |
... foo = 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ conda inspect linkages -n test emacs | |
WARNING: pyldd disagrees with ldd/otool. This will not cause any | |
WARNING: problems for this build, but please file a bug at: | |
WARNING: https://github.com/conda/conda-build | |
WARNING: and (if possible) attach file /home/bjorn/miniconda3/envs/test/bin/ctags | |
WARNING: | |
ldd/otool gives: | |
('linux-vdso.so.1', '') | |
('libc.so.6', '/lib/x86_64-linux-gnu/libc.so.6') | |
pyldd gives: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -uex | |
# usage: | |
# | |
# $ sudo ./test_repo.sh pycvodes/ | |
# | |
# $ sudo ./test_repo.sh pynleq2 -e PYNLEQ2_NLEQ2_ROOT_URL=http://secret.example.com/nleq2/ | |
# | |
# Depends on drone CLI client: | |
# | |
# http://readme.drone.io/0.4/devs/cli/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distutils.core import setup | |
from distutils.extension import Extension | |
from Cython.Distutils import build_ext | |
setup( | |
cmdclass = {'build_ext': build_ext}, | |
ext_modules = [Extension("tracer", ["tracer.pyx"])] | |
) |