Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mcapell on github.
  • I am mcapell (https://keybase.io/mcapell) on keybase.
  • I have a public key ASBNgFf3ci3IW0NK-UU4xgPWJaxXKlXBWjD2yIMZnGWxNgo

To claim this, I am signing this object:

@mcapell
mcapell / rust-python-cffi.md
Created December 9, 2016 14:40 — forked from seanjensengrey/rust-python-cffi.md
Calling Rust from Python/PyPy using CFFI (C Foreign Function Interface)

This is a small demo of how to create a library in Rust and call it from Python (both CPython and PyPy) using the CFFI instead of ctypes.

Based on http://harkablog.com/calling-rust-from-c-and-python.html (dead) which used ctypes

CFFI is nice because:

  • Reads C declarations (parses headers)
  • Works in both CPython and PyPy (included with PyPy)
  • Lower call overhead than ctypes
@mcapell
mcapell / hack.sh
Created June 27, 2012 14:55 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@mcapell
mcapell / AndroidManifest.xml
Last active August 29, 2015 18:27 — forked from BrandonSmith/AndroidManifest.xml
Quick example of how to schedule a notification in the future using AlarmManager
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cards.notification">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
@mcapell
mcapell / _.md
Last active August 29, 2015 14:17 — forked from klange/_.md

Since this is on Hacker News...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later).
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • They're all while loops because shut up, you're overthinking a joke.

Keybase proof

I hereby claim:

  • I am mcapell on github.
  • I am mcapell (https://keybase.io/mcapell) on keybase.
  • I have a public key whose fingerprint is 00B0 C2D2 D365 2A63 C5BC 695D 23CF CBF8 0A59 19A0

To claim this, I am signing this object: