Skip to content

Instantly share code, notes, and snippets.

View rasbt's full-sized avatar

Sebastian Raschka rasbt

View GitHub Profile
@mojavelinux
mojavelinux / Writing Tools Writeup.markdown
Created January 30, 2012 18:56 — forked from matthewmccullough/Writing Tools Writeup.md
How To Write A Technical Book (One Man's Modest Suggestions)
@amueller
amueller / mlp.py
Created March 17, 2012 15:59
Multi-Layer Perceptron for scikit-learn with SGD in Python
import numpy as np
import warnings
from itertools import cycle, izip
from sklearn.utils import gen_even_slices
from sklearn.utils import shuffle
from sklearn.base import BaseEstimator
from sklearn.base import ClassifierMixin
from sklearn.preprocessing import LabelBinarizer
@rocarvaj
rocarvaj / .vimrc
Created April 27, 2012 21:28
Minimal .vimrc for C/C++ developers
" VIM Configuration File
" Description: Optimized for C/C++ development, but useful also for other things.
" Author: Gerhard Gappmeier
"
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
" disable vi compatibility (emulation of old bugs)
@minrk
minrk / ipnbdoctest.py
Last active September 14, 2023 11:23
simple example script for running and testing notebooks.
#!/usr/bin/env python
"""
simple example script for running and testing notebooks.
Usage: `ipnbdoctest.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook.
"""
# License: Public Domain, but credit is nice (Min RK).
@knmkr
knmkr / use_blast_from_command-line.md
Last active October 15, 2022 14:59
How to use blast from command-line, on Mac OS X.

#How to use blast from command-line, on Mac OS X.

Install blast

Download executables (binary) of blast-commands for Mac OS X.

$ curl -O ftp://ftp.ncbi.nih.gov/blast/executables/blast+/2.2.28/ncbi-blast-2.2.28+.dmg
or
$ wget ftp://ftp.ncbi.nih.gov/blast/executables/blast+/2.2.28/ncbi-blast-2.2.28+.dmg
@stefanedwards
stefanedwards / qsub1.py
Last active November 18, 2019 05:12
Python module for scripts running on a computation cluster with qsub. This module allows the script to request information such as job id, running time, remaining running time etc.
######
# author: Stefan McKinnon Edwards <stefan.hoj-edwards@agrsci.dk>
# id: $Id: qsub1.py 25 2013-04-12 11:06:47Z sme $
# qsub-module;
# communicates with cluster-queueing system to retrieve information
# about the current job.
# The qsub commands do no exist on the nodes, so to retrieve the necessary information,
# we ssh the host and request the information from `qstat`.
#
# To use this module from a script running on a computation cluster,
@astrojuanlu
astrojuanlu / pep8magic.py
Last active April 27, 2017 11:00
IPython cell magic to check for PEP8 using https://pypi.python.org/pypi/pep8
# IPython magic to check for PEP8 compliance.
# Author: Juan Luis Cano <juanlu001@gmail.com>
"""IPython magic to check for PEP8 compliance.
To use it, type
```%load_ext pep8magic```
and then
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
__all__ = ["transform"]
__version__ = '0.3'
__author__ = 'Christoph Burgmer <cburgmer@ira.uka.de>'
__url__ = 'http://github.com/cburgmer/upsidedown'
@kracekumar
kracekumar / Writing better python code.md
Last active February 19, 2024 03:06
Talk I gave at June bangpypers meetup.

Writing better python code


Swapping variables

Bad code

@ethanwhite
ethanwhite / git_head_hash.py
Created June 29, 2014 02:56
Get hash of current git HEAD using Python built-ins
import subprocess
process = subprocess.Popen(['git', 'rev-parse', 'HEAD'], shell=False, stdout=subprocess.PIPE)
git_head_hash = process.communicate()[0].strip()