Skip to content

Instantly share code, notes, and snippets.

smashwilson /
Last active Nov 7, 2019
Move a subdirectory from one git repository to a subdirectory of another, without losing commit history.
# Assumptions:
# * After the merge is complete, the directory should exist in the target repository and not exist in the source
# repository. In other words, this is a move, not a cross-reference: we never want to be able to push commits
# back to the source repository, or merge further changes from the source repository. If you want to do that
# instead, a subtree merge is what you're looking for.
# * The directory doesn't exist in the target repository yet.
# In this example, we're moving the "/openstack-swift/" directory from jclouds/jclouds-labs-openstack to
hlung / How to connect a PS3
Last active Apr 20, 2020
How to connect PS3 controller on Mac OSX, PC
View How to connect a PS3

How to connect PS3 controller on Mac OSX, PC, etc.

This is how you connect PS3 controller to Mac OSX, PC, etc. when previously connected to a PS3. You will need a Mini USB cable. Overcome your laziness, get up of your chair, and go get one!

A big misconception is that keep holding PS button will reset the controller's pairing. It DOES NOT! From my testings, the controller keeps paring with the last machine it was CONNECTED VIA A USB CABLE.

Here are the steps:

jvns /
Last active Sep 12, 2020
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

sloria /
Last active Sep 18, 2020
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General


  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
class TableCell(object):
bg_colour = None
def __init__(self, value, header=False, bg_colour=None, text_colour=None):
self.value = value
self.header = header
self.bg_colour = bg_colour
self.text_colour = text_colour
def _make_css(self):
View SharingNotebooks.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
stefanv / ip_consolas.patch
Created Nov 5, 2012
IPython with Consolas
View ip_consolas.patch
$ git diff -w notebook.css
diff --git a/IPython/frontend/html/notebook/static/css/notebook.css b/IPython/frontend
index 9396bf7..55e3a64 100644
--- a/IPython/frontend/html/notebook/static/css/notebook.css
+++ b/IPython/frontend/html/notebook/static/css/notebook.css
@@ -311,6 +311,7 @@ div.text_cell_render {
.CodeMirror {
line-height: 1.231; /* Changed from 1em to our global default */
+ font-family: Consolas;
minrk / SWCDemo.ipynb
Created Oct 4, 2012
Demo of hideable hints and scrubbing solutions from IPython notebooks
View SWCDemo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
minrk /
Created Feb 28, 2012
downgrade v3 ipython notebooks to v2
"""Simple utility script for semi-gracefully downgrading v3 notebooks to v2"""
import io
import os
import sys
from IPython.nbformat import current
def heading_to_md(cell):
"""turn heading cell into corresponding markdown"""
You can’t perform that action at this time.