This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IPython magic to check for PEP8 compliance. | |
# Author: Juan Luis Cano <[email protected]> | |
"""IPython magic to check for PEP8 compliance. | |
To use it, type | |
```%load_ext pep8magic``` | |
and then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
An example of using the `yield from` syntax in python 3 and a generator expression than mimics this. | |
""" | |
def yield_only_odd(i): | |
''' | |
Yield i if and only if i is odd. | |
This is a generator that yields zero or one times. | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def online_mean(): | |
""" | |
Return an initialised generator for online mean (next() has been called). | |
""" | |
omean = _online_mean() | |
next(omean) | |
return omean | |
def _online_mean(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import os, time, argparse | |
from subprocess import call, check_call, check_output | |
def stop_cmd(name): | |
return ['docker', 'stop', name], False | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
notebooks: | |
command: echo created | |
image: busybox | |
volumes: | |
- "~/Google Drive/notebooks:/notebooks" | |
data: | |
command: echo created | |
image: busybox | |
volumes: | |
- "~/Google Drive/data:/data" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Graph(object): | |
def __init__(self, nodes, edges=None): | |
self.nodes = nodes | |
self.edges = set() | |
self.add_edges(edges or set()) | |
def __hash__(self): | |
return hash(frozenset(self.edges)) + hash(frozenset(self.nodes)) | |
def __repr__(self): |
So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode!
Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.
But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.
OlderNewer