Insert
Flag email (will show in your todo), then cycle un/complete.Alt
+Insert
: remove flag.Shift
+F10
brings up the context menu (works everywhere)F3
orCtrl
+E
: search
This file contains 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
/** Convenience functions to stream output from std:: data structures. | |
* | |
* Useful when you do not have a debugger. See test below to get a sense of | |
* what's available. | |
* | |
*/ | |
#include <gmock/gmock.h> | |
#include <gtest/gtest.h> |
This file contains 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
; Simulate clients writing log files to a drive with fio (see https://bsdio.com/fio/) | |
; | |
; numbjobs: number of clients | |
; rate_iops: number of writes per seconds | |
; bs: size of the log entry | |
; size: total size of the log file | |
; | |
; Normally, the iops reported by fio should be rate_iops x numbjobs | |
[global] |
This file contains 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
import numpy as np | |
import numexpr as ne | |
import pandas as pd | |
import matplotlib | |
import matplotlib.pyplot as plt | |
%load_ext autoreload | |
%autoreload 2 | |
%matplotlib inline |
This file contains 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
import pandas as pd | |
def top(df, n, columns=None): | |
"""Returns top and bottom n elements subset of input dataframe. | |
Args: | |
df: input dataframe. | |
n: number of elements to return (n / 2 on top and on the bottom). | |
columns: list of columns to consider for sorting, defaults to use | |
head and tail. |
This file contains 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 add_data_frame_equality_func(test): | |
"""Define test class to handle assertEqual with `pandas.DataFrame`.""" | |
def frame_equal(lhs, rhs, msg=None): | |
"""Adapter for pandas.testing.assert_frame_equal.""" | |
if msg: | |
try: | |
pdt.assert_frame_equal(lhs, rhs) | |
except AssertionError as err: | |
raise test.failureException(msg) | |
else: |
This file contains 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
-- creates fdw to the database quotes in a schema quotes_s | |
create extension if not exists postgres_fdw; | |
create server prod_s foreign data wrapper postgres_fdw options (host 'servername', dbname 'quotes', port '5432'); | |
create user mapping for public server prod_s options (user 'name', password 'secret'); | |
create schema quotes_s; |
This file contains 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
sns.set(style='whitegrid', context='notebook', font_scale=1.5) | |
sns.pairplot(df[cols]) | |
plt.show() |
This file contains 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
sns.set(style='whitegrid', context='notebook', font_scale=1.5) | |
cm = np.corrcoef(df[cols].values.T) | |
hm = sns.heatmap(cm, cbar=True, annot=True, square=True, fmt='.2f', | |
annot_kws={'size': 15}, yticklabels=cols, xticklabels=cols) | |
plt.show() |
This file contains 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
#!/usr/bin/env python | |
# vim: set encoding=utf-8 | |
""" | |
My convenience test runners for unittest. | |
Place it in your tests folder and use it with python -m <test folder>. | |
(Requires click, and colorama (if you want colors)). | |
Allows one to run your tests in your tests folder in a spartain way: |
NewerOlder