Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
git ls-files | grep '\.swp$' | xargs git rm |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "precise64" | |
# The url from where the 'config.vm.box' box will be fetched if it | |
# doesn't already exist on the user's system. |
On the Refinery29 Mobile Web Team, codenamed "Bicycle", all of our unit tests are written using Jasmine, an awesome BDD library written by Pivotal Labs. We recently switched how we set up data for tests from declaring and assigning to closures, to assigning properties to each test case's this
object, and we've seen some awesome benefits from doing such.
Up until recently, a typical unit test for us looked something like this:
describe('views.Card', function() {
#!/bin/bash | |
# Set up the packages we need | |
apt-get update | |
apt-get install git vim -y | |
# Clone the devstack repo | |
git clone https://github.com/openstack-dev/devstack.git /tmp/devstack | |
cat <<EOF > /tmp/devstack/localrc |
#! /usr/bin/env python | |
"""Git pre-commit hook to run pylint on python files. | |
To install: | |
wget https://gist.github.com/nivbend/7e0e306a98138916b3c9#file-run_pylint-py -O .git/hooks/pre-commit | |
""" | |
from __future__ import print_function | |
from subprocess import check_output, CalledProcessError | |
from sys import stderr |
#!/usr/bin/osascript | |
# usage: zoom <room-number> [room-password] [--name=NAME] | |
on split(theString, theDelimiter) | |
set oldDelimiters to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to theDelimiter | |
set theArray to every text item of theString | |
set AppleScript's text item delimiters to oldDelimiters | |
return theArray |
This gist shows how to create a GIF screencast using only free OS X tools: QuickTime and ffmpeg.
Forked from https://gist.github.com/dergachev/4627207. Updated to use a palette to improve quality and skip gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application: