-
Thou shall use version control.
-
Thou shall comment thy code.
-
Thou shall use existing libraries whenever possible.
-
Thou shall try to unit test.
#!/bin/bash | |
# This hook is run after a new virtualenv is activated. | |
# ~/.virtualenvs/postmkvirtualenv | |
libs=( PyQt4 sip.so ) | |
python_version=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") | |
var=( $(which -a $python_version) ) | |
get_python_lib_cmd="from distutils.sysconfig import get_python_lib; print (get_python_lib())" |
#!/usr/bin/env ruby | |
# A small ruby script to extract a git history to a tikz picture | |
# Author: Michael Hauspie <[email protected]> | |
# | |
# Not clean code, not always working well, but does its job in most of the cases I needed :) | |
# A commit object | |
class Commit | |
attr_accessor :hash |
#!/bin/bash | |
# A simple script to backup an organization's GitHub repositories. | |
#------------------------------------------------------------------------------- | |
# NOTES: | |
#------------------------------------------------------------------------------- | |
# * Under the heading "CONFIG" below you'll find a number of configuration | |
# parameters that must be personalized for your GitHub account and org. | |
# Replace the `<CHANGE-ME>` strings with the value described in the comments | |
# (or overwrite those values at run-time by providing environment variables). |
import itertools | |
from collections import Counter | |
def euler_52(): | |
for i in itertools.count(1): | |
nums = [str(i * j) for j in range(1, 7)] | |
s = frozenset(nums[0]) | |
sall = set() | |
sall.update(*nums) | |
if sall == s: |
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): |
Either copy the aliases from the .gitconfig
or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4
- creates local branchpr/4
from the githubupstream
(if it exists) ororigin
remote and checks it outgit pr 4 someremote
- creates local branchpr/4
fromsomeremote
remote and checks it out
This guide documents how we set up an easy workflow for using the IPython Notebook on our compute cluster managed with Sun Grid Engine (SGE).
Summary: We provide a script to the cluster users that runs qrsh
to schedule an ipython notebook
job using SSL and password protection.
GitLab is open source software to collaborate on code (a GitHub clone to run on your own server). Clicking a blob (a file in a repository) in GitLab shows a nice rendering if GitLab supports the file type (e.g., images, Markdown documents), or its content as plain text otherwise. The patch described here adds support to GitLab for rendering IPython notebooks (.ipynb files).
This describes how I installed and configured my Raspberry Pi model B (512MB).
The Pi is mainly used as SSH jump host, IRC client, Git server, backup fileserver, etc. It doesn't need stellar performance, it just has to be cheap, low in power usage, and secure.