Skip to content

Instantly share code, notes, and snippets.

View jaumebonet's full-sized avatar

Jaume Bonet jaumebonet

  • Lausanne, Switzerland
View GitHub Profile
@jaumebonet
jaumebonet / sftp_pandas.py
Created April 27, 2021 16:42 — forked from Kautenja/sftp_pandas.py
Functions for working with remote files using pandas and paramiko (SFTP/SSH).
"""Functions for working with remote files using pandas and paramiko (SFTP/SSH)."""
import pandas as pd
import paramiko
def read_csv_sftp(hostname: str, username: str, remotepath: str, *args, **kwargs) -> pd.DataFrame:
"""
Read a file from a remote host using SFTP over SSH.
Args:
@jaumebonet
jaumebonet / gist:da18c7c8d8837cdd68d9379cb0c8d551
Created January 23, 2018 13:14 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jaumebonet
jaumebonet / .vimrc
Last active January 31, 2017 17:22
Because I might not find it again...
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"
@jaumebonet
jaumebonet / preRender.pymolcom
Last active March 14, 2019 12:30
Pymol Command Scripts
cartoon automatic
set cartoon_loop_radius, 0.3
set cartoon_side_chain_helper, 1
set cartoon_discrete_colors, 1
bg_color white
set ray_opaque_background, off
set ray_texture, 5
set ray_shadows, 0
set antialias, 2
set ray_trace_mode, 1
@jaumebonet
jaumebonet / install.sh
Last active November 1, 2021 15:59
Setup for a new install [MAC] (after installing Xcode & command line tools)
###
# WARNING!
###
# Do you use .bashrc for configuration of your shell?? IF so, do this first:
cat '[[ -s ~/.bashrc ]] && source ~/.bashrc' > ~/.bash_profile
###
# Install homebrew
###
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@jaumebonet
jaumebonet / mac_chime.bash
Created May 7, 2015 13:09
Mac StartUp Chime Control
#Deactivate Startup Chime
sudo nvram SystemAudioVolume=%80
#Activate Startup Chime
sudo nvram -d SystemAudioVolume
@jaumebonet
jaumebonet / sort_list_of _dict.py
Last active August 29, 2015 14:19
Sort list of dictionaries by value of a given key
# from: http://stackoverflow.com/a/73050/2806632
from operator import itemgetter
l = [] # List of dictionaries
k = '' # Key of interest to sort by
# [..] fill list 'l' with dictionaries containing a 'k' key
newlist = sorted(l, key=itemgetter(k), reverse=True) # reverse boolean for ascending/descending sort
@jaumebonet
jaumebonet / alphabet_list.py
Created February 2, 2015 14:23
Create ascii ordered list of letters
first_letter = 'A'
last_letter = 'Z'
alphabet = list(map(chr, range(ord(first_letter), ord(last_letter) + 1)))
@jaumebonet
jaumebonet / index.html
Last active August 29, 2015 14:10 — forked from EpokK/ngEnter.js
React to Press Enter, the AngularJS way
<div>
<input
type = "text"
placeholder = "Something to say"
ng-model = "target_variable"
ng-pattern = 'pattern_variable'
jb-on-enter = "executeCommand()"
>
</div>
@jaumebonet
jaumebonet / substitute.bash
Created April 2, 2014 09:31
Substitute something inside a file... for a huge bunch of files
find $1 -name '$2' -exec sed -i '$3' '{}' \;
# WHERE:
# $1 = folder
# $2 = file pattern
# $2 = substitution pattern (such as: s/\.src\./\./g )