Skip to content

Instantly share code, notes, and snippets.

For ETS's SKLL project, we found out the hard way that Travis-CI's support for numpy and scipy is pretty abysmal. There are pre-installed versions of numpy for some versions of Python, but those are seriously out of date, and scipy is not there are at all. The two most popular approaches for working around this are to (1) build everything from scratch, or (2) use apt-get to install more recent (but still out of date) versions of numpy and scipy. Both of these approaches lead to longer build times, and with the second approach, you still don't have the most recent versions of anything. To circumvent these issues, we've switched to using Miniconda (Anaconda's lightweight cousin) to install everything.

A template for installing a simple Python package that relies on numpy and scipy using Miniconda is provided below. Since it's a common s

@mgk
mgk / gist:cb8cf7ea932dfbe7ac6f
Last active August 29, 2015 14:02 — forked from lucasfais/gist:1207002
Sublime Text Mac Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@mgk
mgk / README.md
Last active August 29, 2015 14:10 — forked from rkirsling/LICENSE

Click in the open space to add a node, drag from one node to another to add an edge.
Ctrl-drag a node to move the graph layout.
Click a node or an edge to select it.

When a node is selected: R toggles reflexivity, Delete removes the node.
When an edge is selected: L(eft), R(ight), B(oth) change direction, Delete removes the edge.

To see this example as part of a larger project, check out Modal Logic Playground!

@mgk
mgk / rqretryworker.py
Last active August 29, 2015 14:25 — forked from spjwebster/rqretryworker.py
A basic rq worker that will retry failed jobs before dumping it in the failed queue.
#!/usr/bin/env python
import os, sys
sys.path.append(os.getcwd())
import logging
import rq
MAX_FAILURES = 3
#############################################################
# Function -- Boot2Docker
#############################################################
if test "$(which boot2docker 2> /dev/null)"; then
function docker_shellinit {
local _shellinit="$(boot2docker shellinit)"
eval "$(echo ${_shellinit})"
echo "${_shellinit}" > ~/.boot2dockerrc
}
@mgk
mgk / install-redis.sh
Last active August 29, 2015 14:27 — forked from four43/install-redis.sh
Install Redis
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://gist.githubusercontent.com/four43/e00d01ca084c5972f229/raw/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@mgk
mgk / redis-server
Last active August 29, 2015 14:27 — forked from four43/redis-server
Redis Server - Init Script
#!/bin/sh
# From - http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# - https://github.com/saxenap/install-redis-amazon-linux-centos/blob/master/redis-server
#
# redis - this script starts and stops the redis-server daemon
# Originally from - https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
@mgk
mgk / ec623a.diff
Created October 14, 2015 15:50
test libvpx 1082 patch
From ec623a0bb712f3519cd8f5c5be1ac464081c7411 Mon Sep 17 00:00:00 2001
From: Johann <[email protected]>
Date: Tue, 13 Oct 2015 10:36:16 -0700
Subject: [PATCH] Upstream Mozilla fix for older Apple clang builds
Also use the _mm_broadcastsi128_si256 intrisic for
Apple clang versions 4.[012]
https://bugzilla.mozilla.org/show_bug.cgi?id=1085607
https://code.google.com/p/webm/issues/detail?id=1082
@mgk
mgk / apple-clang-2.patch
Last active October 14, 2015 16:21
remove > 0 check in libvpx patch
diff --git a/media/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c b/media/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c
--- a/media/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c
+++ b/media/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c
@@ -27,21 +27,24 @@ DECLARE_ALIGNED(32, static const uint8_t
4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12
};
DECLARE_ALIGNED(32, static const uint8_t, filt4_global_avx2[32]) = {
6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14,
6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14
@mgk
mgk / 3a4d4c6.diff
Created October 14, 2015 19:17
second patch for libvpx 1082
From 3a4d4c6b23c1d604f18437835a700182758717e9 Mon Sep 17 00:00:00 2001
From: Johann <[email protected]>
Date: Wed, 14 Oct 2015 10:42:41 -0700
Subject: [PATCH] Check for bswap* builtins before using
Canonical builtin checks for clang are to use
__has_builtin. Much less fragile than version checks.
https://code.google.com/p/webm/issues/detail?id=1082