Skip to content

Instantly share code, notes, and snippets.

Bor González Usach bgusach

Block or report user

Report or block bgusach

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bgusach
bgusach / multireplace.py
Last active Nov 15, 2019
Python string multireplacement
View multireplace.py
def multireplace(string, replacements, ignore_case=False):
"""
Given a string and a replacement map, it returns the replaced string.
:param str string: string to execute replacements on
:param dict replacements: replacement dictionary {value to find: value to replace}
:param bool ignore_case: whether the match should be case insensitive
:rtype: str
"""
View remove-orphan-raws.py
#!/usr/bin/env python
# coding: utf-8
"""
Tool to detect and delete orphan raw files
"""
from __future__ import unicode_literals, print_function
You can’t perform that action at this time.