Skip to content

Instantly share code, notes, and snippets.

View Carreau's full-sized avatar
:octocat:

M Bussonnier Carreau

:octocat:
View GitHub Profile
@Carreau
Carreau / proof
Created October 14, 2017 21:37
Keybase 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 September 20, 2017 19:52
import magic.
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()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 December 25, 2016 19:14
use to convert txt peps to rst.
from textwrap import indent, wrap
from more_itertools import peekable
WRAPL_LENGHT = 70
indent_level = lambda line: len(line) - len(line.lstrip())
import re
$ 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
> 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 19:52
Xonsh + IPython 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
@Carreau
Carreau / jeditb.py
Created April 13, 2016 10:25
Jeditraceback
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
~/jedi/cache.py in wrapper(self)
140 try:
--> 141 return getattr(self, name)
142 except AttributeError:
AttributeError: 'UserContextParser' object has no attribute '__parser'
During handling of the above exception, another exception occurred:
from prompt_toolkit.application import Application
from prompt_toolkit.interface import CommandLineInterface
from prompt_toolkit.key_binding.manager import KeyBindingManager
from prompt_toolkit.keys import Keys
from prompt_toolkit.enums import DEFAULT_BUFFER
from prompt_toolkit.layout.containers import HSplit, Window, VSplit, ConditionalContainer
from prompt_toolkit.layout.controls import BufferControl, FillControl, TokenListControl
from prompt_toolkit.buffer import Buffer
from prompt_toolkit.layout.dimension import LayoutDimension