Skip to content

Instantly share code, notes, and snippets.

@mattions
mattions / myapp.py
Created December 18, 2013 18:07
quick embedded Gunicorn app
from gunicorn.app.base import Application, Config
class GUnicornFlaskApplication(Application):
def __init__(self, app):
self.usage, self.callable, self.prog, self.app = None, None, None, app
def run(self, **options):
self.cfg = Config()
[self.cfg.set(key, value) for key, value in options.items()]
# blackkiwi - production app
FROM mattions/webber:1.0
MAINTAINER mattions "mattions@gmail.com"
ENV DEBIAN_FRONTEND noninteractive
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get -qy install\
python3 \
# Upgrade your requirements
# - Finds outdated package with pip
# - install latest stable version
# - Update the requirements with the latest
pip list --outdated | cut -d' ' -f1 | xargs pip install --upgrade
pip freeze > requirements.txt
@mattions
mattions / matplotlibrc
Last active October 7, 2017 23:58 — forked from huyng/matplotlibrc
Matplotlib style to have a default similar to ggplot2. Inspired by http://www.huyng.com/posts/sane-color-scheme-for-matplotlib/
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overwritten in your next install.
# If you want to keep a permanent local copy that will not be
# overwritten, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).

Your Vision

What is a vision?

Your vision answers the question "What do I want?" A clear vision help you communicate why you're here and what impact you're going to have.

Your vision should be aligned with the company vision, with your manager's V2MOM, and it should be personal. It should be an honest reflection of your own vision for your own work.

If you manage a team, it should be reflective of the purpose of the team and your collective impact.

@mattions
mattions / INSTALL.md
Created April 17, 2018 20:16 — forked from vfdev-5/INSTALL.md
Jackal simulation in ROS kinetic

Install dependencies :

This is manual way to install necessary packages :

sudo apt-get install ros-kinetic-robot-localization ros-kinetic-controller-manager ros-kinetic-joint-state-controller ros-kinetic-diff-drive-controller ros-kinetic-gazebo-ros ros-kinetic-gazebo-ros-control ros-kinetic-gazebo-plugins             ros-kinetic-lms1xx ros-kinetic-pointgrey-camera-description ros-kinetic-roslint ros-kinetic-amcl ros-kinetic-gmapping      ros-kinetic-map-server ros-kinetic-move-base ros-kinetic-urdf ros-kinetic-xacro ros-kinetic-message-runtime ros-kinetic-topic-tools ros-kinetic-teleop-twist-joy

If you want to use rosdep and install all dependencies (for example for doc generation etc), the skip this step.

Create a workspace and clone sources

import pandas as pd
data = {"colA": [1, 2 , 3, 4, 5, 6, 7 ,8],
"colB": ["one", "two", "one", "two", "one", "two", "one", "two"]}
df = pd.DataFrame(data)
# Always use the pattern
# df.loc[<selector>, column_to_change] = value
# selector is usually df['a_column'] == "something"
# the column can be one or more.
@mattions
mattions / launch_st_viewer.sh
Last active May 4, 2018 16:06
SBG FS and ST Viewer helper scripts
# Launch the docker container of the latest st_viewer
# Note: We are using the $SBG_SBFS_MOUNT_POINT variable
# You can replace that with the actual path if you do not
# want to use the env variable. Check the `sbfs-privileges.sh`
# file for details.
#
# The mounted projects will be found at `/STDatasets` mount point
# within the docker container
xhost +local:root
@mattions
mattions / setup.sh
Last active October 25, 2018 14:25 — forked from fracasula/setup.sh
How to install Bluejeans on Ubuntu
sudo apt install alien -y
sudo alien bluejeans_1.28.9-2_amd64.rpm # or whatever is the file you downloaded from the bluejeans website
sudo dpkg -i bluejeans_1.28.9-2_amd64.deb
cd /lib/x86_64-linux-gnu
#sudo ln -s libudev.so libudev.so.0
sudo ln -s libudev.so.1 libudev.so.0
# now you can launch bluejeans
/opt/bluejeans/bluejeans-bin
import sevenbridges as sbg
c = sbg.Config(profile='cavatica')
api = sbg.Api(config=c)
bg = api.billing_groups.get(id='14bc19f2-6a6a-4a44-bb07-f86020dad9c0')
breakdown = bg.breakdown()
for project_breakdown in breakdown.project_breakdown:
project_id_parsed = (project_breakdown.href.split("/")[-2:])
project_id = "/".join(project_id_parsed)
print(project_id)