Skip to content

Instantly share code, notes, and snippets.

Dougal J. Sutherland dougalsutherland

Block or report user

Report or block dougalsutherland

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@GaelVaroquaux
GaelVaroquaux / 00README.rst
Created Sep 28, 2011
Copy-less bindings of C-generated arrays with Cython
View 00README.rst

Cython example of exposing C-computed arrays in Python without data copies

The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.

The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy

@erikh
erikh / hack.sh
Created Mar 31, 2012 — forked from DAddYE/hack.sh
OSX For Hackers
View hack.sh
#!/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
#
@endolith
endolith / Accent.py
Last active Apr 24, 2019
Documenting the matplotlib colormaps
View Accent.py
# https://github.com/matplotlib/matplotlib/issues/881
# Several of the ColorBrewer maps are "qualitative", meaning
# they are just a group of colors that can be used together
# for categories of data. So I remapped Accent to segments
# instead of continuous:
# Actually, these should be used with ListedColormap, and
# the number of colors should depend on the number of
# categories in the data, with colors removed from the
# list in a certain order?
@austinhappel
austinhappel / how-to-connect-an-iOS-device-to-your-computer-using-SOCKS.md
Last active Mar 21, 2019
How to connect an iOS device to your computer via a SOCKS proxy. Say you're running a virtual machine on your work computer. Say this machine, for whatever reason, can only connect to the internet over NAT - as in, it does not get it's own IP address. Say this VM is running a webserver, and you need a device outside of your computer to connect t…
View how-to-connect-an-iOS-device-to-your-computer-using-SOCKS.md

How to connect an iOS device to your computer via a SOCKS proxy

Say you're running a virtual machine on your work computer. Say this machine, for whatever reason, can only connect to the internet over NAT - as in, it does not get it's own IP address. Say this VM is running a webserver, and you need a device outside of your computer to connect to it.

If only there was a way to get your work computer to 'share' it's network, so that you could get at that VM… Here's how you do it!

For all instructions, I assume your work computer is a mac

  1. Get your computer's IP address:
@adamstegman
adamstegman / available_ebooks.rb
Last active Aug 6, 2016
eBooks from my Goodreads to-read list that are available to check out from OverDrive, sorted by average rating on Goodreads
View available_ebooks.rb
#!/usr/bin/env ruby
require 'json'
require 'logger'
require 'net/http'
require 'addressable/template'
require 'mechanize'
require 'nokogiri'
View dcgan.py
import torch
import torch.nn as nn
import torch.nn.parallel
class DCGAN_D(nn.Container):
def __init__(self, isize, nz, nc, ndf, ngpu, n_extra_layers=0):
super(DCGAN_D, self).__init__()
self.ngpu = ngpu
assert isize % 16 == 0, "isize has to be a multiple of 16"
View how-to-make-a-racist-ai-without-really-trying.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.