start new:
tmux
start new with session name:
tmux new -s myname
# Description: Jekyll plugin to replace Markdown image syntax with {% picture %} tag for crafting responsive images | |
# place in /_plugins/ | |
Jekyll::Hooks.register :posts, :pre_render do |post, payload| | |
docExt = post.extname.tr('.', '') | |
# only process if we deal with a markdown file | |
if payload['site']['markdown_ext'].include? docExt | |
newContent = post.content.gsub(/\!\[(.+)\]\((.+)\)/, '{% picture default \2 alt="\1" %}') | |
post.content = newContent | |
end |
"""Sample that implements gRPC client for Google Assistant API.""" | |
from google.assistant.embedded.v1alpha1 import embedded_assistant_pb2 | |
from google.rpc import code_pb2 | |
import logging | |
import os.path | |
from googlesamples.assistant import ( | |
assistant_helpers, | |
audio_helpers, |
This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.
To use the script, follow the instructions given in the script's docstring.
For further details, read this blogpost.
The procedure outlined here is inspired by this answer on Stack Overflow.
#List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
#Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
#Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(value_list)] |
""" | |
VCF.py | |
Kamil Slowikowski | |
October 30, 2013 | |
Read VCF files. Works with gzip compressed files and pandas. | |
Note: This module ignores the genotype columns because | |
I didn't need them at the time of writing. |