Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Matthias Bussonnier Carreau

:octocat:
View GitHub Profile
View BinderLogo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Carreau
Carreau / main.rs
Last active Mar 3, 2018
Rust From error
View main.rs
// in the following snippet, cargo complains:
//
// error[E0277]: the trait bound `B: std::convert::From<&A>` is not satisfied
// --> src/main.rs:54:21
// |
// 54 | let dn: B = B::from(n);
// | ^^^^^^^ the trait `std::convert::From<&A>` is not implemented for `B`
// |
// = help: the following implementations were found:
// <B as std::convert::From<A>>
@Carreau
Carreau / proof
Created Oct 14, 2017
Keybase Proof
View proof
### Keybase proof
I hereby claim:
* I am carreau on github.
* I am mbussonn (https://keybase.io/mbussonn) on keybase.
* I have a public key ASCnMPrYcBgBueQ180i9ks1TWulXMXFYs_bdj1xJ6pVxtgo
To claim this, I am signing this object:
@Carreau
Carreau / foo.py
Created Sep 20, 2017
import magic.
View foo.py
from IPython.core.magic import Magics, magics_class, line_magic
@magics_class
class Waskom(Magics):
@line_magic
def michael(self, line):
self.shell.set_next_input('import seaborn as sns')
ip = get_ipython()
View Disp-Requests.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:4ed0987c3671d9cb92cf3b8a29542619
In [12]: jedi.Interpreter('s.dat',[ {'s':s}], line=1, column=5).completions()[0].type
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/Users/bussonniermatthias/dev/jedi/jedi/parser/utils.py in wrapper(self)
37 try:
---> 38 return getattr(self, name)
39 except AttributeError:
AttributeError: 'CompiledName' object has no attribute '_infer'
@Carreau
Carreau / rstify.py
Created Dec 25, 2016
use to convert txt peps to rst.
View rstify.py
from textwrap import indent, wrap
from more_itertools import peekable
WRAPL_LENGHT = 70
indent_level = lambda line: len(line) - len(line.lstrip())
import re
View make initdb fail
$ docker-machine start
$ eval $(docker-machine env)
$ make build
$ make serve # all is fine
$ # in a second terminal :
$ eval $(docker-machine env)
$ make initdb
docker-compose run web psql -h db -d postgres -U postgres -c "DROP DATABASE IF EXISTS warehouse"
Starting warehouse_elasticsearch_1
View labcrashinstall.log
> webpack --config webpack.conf.js
ModuleNotFoundError: Module not found: Error: Cannot resolve module 'jquery-ui/themes/smoothness/jquery-ui.min.css' in /Users/bussonniermatthias/dev/jupyterlab/jupyterlab/node_modules/jupyterlab/lib/widgets
at /Users/bussonniermatthias/dev/jupyterlab/jupyterlab/node_modules/webpack/lib/Compilation.js:229:38
at onDoneResolving (/Users/bussonniermatthias/dev/jupyterlab/jupyterlab/node_modules/webpack/lib/NormalModuleFactory.js:29:20)
at /Users/bussonniermatthias/dev/jupyterlab/jupyterlab/node_modules/webpack/lib/NormalModuleFactory.js:85:20
at /Users/bussonniermatthias/dev/jupyterlab/jupyterlab/node_modules/async/lib/async.js:726:13
at /Users/bussonniermatthias/dev/jupyterlab/jupyterlab/node_modules/async/lib/async.js:52:16
at done (/Users/bussonniermatthias/dev/jupyterlab/jupyterlab/node_modules/async/lib/async.js:241:17)
at /Users/bussonniermatthias/dev/jupyterlab/jupyterlab/node_modules/async/lib/async.js:44:16
@Carreau
Carreau / crash
Created May 25, 2016
Xonsh + IPython crash
View crash
Matthiass-MacBook-Pro:~ bussonniermatthias$ mkdir test
Matthiass-MacBook-Pro:~ bussonniermatthias$ cd test
Matthiass-MacBook-Pro:test bussonniermatthias$ xonsh
(rootenv)~/test$ ipython > foo
Traceback (most recent call last):
File "/Users/bussonniermatthias/dev/prompt_toolkit/prompt_toolkit/interface.py", line 385, in run
self._redraw()
File "/Users/bussonniermatthias/dev/prompt_toolkit/prompt_toolkit/interface.py", line 344, in _redraw
self.renderer.render(self, self.layout, is_done=self.is_done)
File "/Users/bussonniermatthias/dev/prompt_toolkit/prompt_toolkit/renderer.py", line 391, in render
You can’t perform that action at this time.