Skip to content

Instantly share code, notes, and snippets.

@nuin
nuin / CouchDB_Python.md
Created January 22, 2023 02:13 — forked from marians/CouchDB_Python.md
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@nuin
nuin / pre-push.sh
Created January 22, 2023 02:13 — forked from vlucas/pre-push.sh
Prevent Pushes Directly to Master
#!/bin/bash
# @link https://gist.github.com/mattscilipoti/8424018
#
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
@nuin
nuin / 00_Makefile_LaTeX_README.md
Created January 29, 2022 02:40 — forked from tueda/00_Makefile_LaTeX_README.md
Makefile for LaTeX documents. #make #latex

This project is superceded by makefile4latex.

Makefile for LaTeX

This is a GNU Makefile for typesetting LaTeX documents. Expected to work with TeXLive on Linux (and similar systems, e.g., on Cygwin). Just download Makefile and put it in a directory that contains your LaTeX files. Running make will generate PDF files for you:

@nuin
nuin / pocketdedupe.py
Created April 18, 2017 20:03 — forked from Mierdin/pocketdedupe.py
A Python script to intelligently remove duplicate entries from Pocket
#!/usr/bin/env python
from pocket import Pocket
import webbrowser, sys
# Get consumer key from cmd line
consumer_key = sys.argv[1]
request_token = Pocket.get_request_token(
consumer_key=consumer_key,
@nuin
nuin / ssh_client.py
Created September 29, 2016 20:26 — forked from ghawkgu/ssh_client.py
Python ssh client sample
#!/usr/bin/env python
import paramiko
hostname = 'localhost'
port = 22
username = 'foo'
password = 'xxxYYYxxx'
if __name__ == "__main__":
@nuin
nuin / useful_pandas_snippets.py
Created May 4, 2016 16:46 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
#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)]
#Paulo Nuin March 2013
#script that gets the Uniprot accession from a list of gene names
import rethinkdb as r
import sys
gene_table = open(sys.argv[1]).read().splitlines()
#Paulo Nuin March 2013
#script that extracts gene information from uniprot and saves into a Rethinkdb database
#database is created if needed
#table proteins:
# name (gene name)
# synonyms
# organism
# uniprot_id
# sequence (protein)
# ensembl ids (gene, transcript, protein)
@nuin
nuin / gist:5201776
Created March 20, 2013 02:08
Uniprot parser
#Paulo Nuin March 2013
#script that extracts gene information from uniprot and saves into a sqlite3 database
#database is created if needed
#table proteins:
# name (gene name)
# synonyms
# organism
# uniprot_id
# sequence (protein)
# ensembl ids (gene, transcript, protein)
@nuin
nuin / matplotlibrc
Created June 18, 2012 20:18 — forked from huyng/matplotlibrc
my default matplotlib settings
### 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 overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).