Skip to content

Instantly share code, notes, and snippets.

@rossant
rossant / handsondataframe.ipynb
Created March 10, 2014 12:08
Excel-like data grid editor for Pandas in the IPython notebook with Handsontable
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
import requests
import shutil
def _dl(url, path):
print("download", url, "to", path)
response = requests.get(url, stream=True)
if response.status_code != 200:
return
@rossant
rossant / vispy-text
Last active February 12, 2019 14:17
vispy text
We couldn’t find that file to show.
@rossant
rossant / points.py
Created December 15, 2014 16:23
VisPy example: interactive cloud of points in 3D
import sys
import numpy as np
from vispy import app, scene
canvas = scene.SceneCanvas(keys='interactive')
view = canvas.central_widget.add_view()
view.set_camera('turntable', mode='perspective', up='z', distance=2,
azimuth=30., elevation=30.)
pos = .25 * np.random.randn(1000, 3)
@rossant
rossant / broken.md
Last active September 3, 2018 06:32
Consider your software broken if

Consider your software broken if:

  • You're the only one to understand how it works
  • You can't remember what a function does just by reading its name
  • You're not using a version control system
  • You're not using continuous integration
  • You're not continuously monitoring the quality of your code
  • You have little or no unit tests
  • You have little or no integration tests
  • You don't use an issue tracker
@rossant
rossant / latest_pandoc.sh
Created March 28, 2016 14:14
Install latest .deb pandoc, using the GitHub release page -- useful on CI systems
URL="https://github.com/jgm/pandoc/releases/latest"
PANDOCPAGE="$(wget $URL -q -O -)"
DEBURL="$(echo $PANDOCPAGE | grep -oP '"([^"]+.deb)"')"
DEBURL="${DEBURL:1:-1}"
URL="http://github.com/$DEBURL"
wget $URL -O pandoc.deb
sudo dpkg -i pandoc.deb
@rossant
rossant / numpy_tricks
Last active February 26, 2017 19:28
Numpy performance tricks
{
"metadata": {
"name": "numpy_tricks"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@rossant
rossant / code_postal.vba
Last active December 2, 2016 20:26
VBA code to find French cities associated to a given postal code
Function collectionToArray(c As Collection) As Variant()
Dim a() As Variant: ReDim a(0 To c.Count - 1)
Dim i As Integer
For i = 1 To c.Count
a(i - 1) = c.Item(i)
Next
collectionToArray = a
End Function
@rossant
rossant / velib
Created May 5, 2013 14:12
Playing with Velib' open data.
{
"metadata": {
"name": "Velib"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@rossant
rossant / installer.md
Last active March 26, 2016 18:06
Build cross-plaform graphical installers for Python software

Distributing Python software to non-technical users is too hard. We need to make it simpler.

I'm imagining a tool based on conda.

Ideally I'd like to have something like this:

  • I write an environment.yml file with the conda/pip dependencies for my software
  • I write an installer.yml file that describes my installer: package name, paths to logo/images, icon shortcuts for binaries, etc.
  • I type build-installer and a few files are created:
  • mypackage.sh: for Unix systems