Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env zsh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2020-01-10 16:20:44 (UTC+0100)
# Simple bar chart plotting in a terminal by reading integer from stdin
# FIELD: Field number to read the value from
#!/usr/bin/env sh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2020-01-09 11:32:55 (UTC+0100)
if [ $# -eq 1 ]; then
cp -pvi "$1" "${1}.bak"
else
#!/usr/bin/env zsh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2019-11-22 09:50:40 (UTC+0100)
# Store the type password in PASSWORD variable
# -s turns off echoing in bash or zsh
# -r for reading backslashes as-is
<div id="viewport" style="width:100%; height:100%;"></div>
<script src="https://cdn.rawgit.com/arose/ngl/v2.0.0-dev.31/dist/ngl.js"></script>
<script>
// Handle window resizing
window.addEventListener( "resize", function( event ){
stage.handleResize();
}, false );
// Create NGL Stage object
var stage = new NGL.Stage( "viewport" );
<div id="viewport" style="width:100%; height:100%;"></div>
<script src="https://cdn.rawgit.com/arose/ngl/v2.0.0-dev.31/dist/ngl.js"></script>
<script>
// Create NGL Stage object
var stage = new NGL.Stage( "viewport" );
var stickRepr
var stickSel = ""
// Handle window resizing
window.addEventListener( "resize", function( event ){
#!/usr/bin/env python3
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2019-10-24 16:26:04 (UTC+0200)
import numpy
def get_cov(M, axis=1):
@bougui505
bougui505 / filter.sh
Last active September 19, 2019 09:23
#!/usr/bin/env zsh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2019-09-19 11:04:47 (UTC+0200)
STRING=$1
awk -v STRING=$STRING '{
#!/usr/bin/env python3
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2019-05-21 10:28:39 (UTC+0200)
import sys
import mrcfile
@bougui505
bougui505 / get_topology.py
Last active August 19, 2020 15:11
Read a pdb filename using pymol and return a topology and coordinates. Save a pdb filename from topology and coordinates using pymol.
#!/usr/bin/env python
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2019-04-12 13:53:36 (UTC+0200)
import sys
import __main__
__main__.pymol_argv = ['pymol', '-qc'] # Optionnaly pass options to pymol
#!/usr/bin/env python
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@pasteur.fr
# https://research.pasteur.fr/en/member/guillaume-bouvier/
# 2019-04-08 16:15:11 (UTC+0200)
import sys
import __main__
__main__.pymol_argv = ['pymol', '-cq'] # Optionnaly pass options to pymol