Not using versioning on your configuration files and editing them with Vim?
Use Vim’s backup option to automatically keep a copy of past versions. To put in your ~/.vimrc:
"Turn on backup option
set backup| # -*- coding: utf-8 -*- | |
| import unicodedata | |
| """ Normalise (normalize) unicode data in Python to remove umlauts, accents etc. """ | |
| data = u'naïve café' | |
| normal = unicodedata.normalize('NFKD', data).encode('ASCII', 'ignore') | |
| print normal | |
| $ git branch -r --merged | | |
| grep origin | | |
| grep -v '>' | | |
| grep -v master | | |
| xargs -L1 | | |
| awk '{split($0,a,"/"); print a[2]}' | | |
| xargs git push origin --delete |
| import logging | |
| import logging.handlers | |
| log = logging.getLogger(__name__) | |
| log.setLevel(logging.DEBUG) | |
| handler = logging.handlers.SysLogHandler(address = '/dev/log') | |
| formatter = logging.Formatter('%(module)s.%(funcName)s: %(message)s') |
| #!/usr/bin/env python | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| """ |
| INSERT INTO CID10 VALUES ('A00.0','Cólera devida a Vibrio 01, biótipo '); | |
| INSERT INTO CID10 VALUES ('A00.1','Cólera devida a Vibrio 01, biótipo El Tor'); | |
| INSERT INTO CID10 VALUES ('A00.9','Cólera não especificada'); | |
| INSERT INTO CID10 VALUES ('A01.0','Febre tifóide'); | |
| INSERT INTO CID10 VALUES ('A01.1','Febre paratifóide A'); | |
| INSERT INTO CID10 VALUES ('A01.2','Febre paratifóide B'); | |
| INSERT INTO CID10 VALUES ('A01.3','Febre paratifóide C'); | |
| INSERT INTO CID10 VALUES ('A01.4','Febre paratifóide não especificada'); | |
| INSERT INTO CID10 VALUES ('A02.0','Enterite por salmonela'); |
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import requests | |
| import sys | |
| import json | |
| def hipchat_notify(token, room, message, color='yellow', notify=False, | |
| format='text', host='api.hipchat.com'): |
| http://www.oreilly.com/data/free/files/2014-data-science-salary-survey.pdf | |
| http://www.oreilly.com/data/free/files/2015-data-science-salary-survey.pdf | |
| http://www.oreilly.com/data/free/files/Data_Analytics_in_Sports.pdf | |
| http://www.oreilly.com/data/free/files/advancing-procurement-analytics.pdf | |
| http://www.oreilly.com/data/free/files/ai-and-medicine.pdf | |
| http://www.oreilly.com/data/free/files/analyzing-data-in-the-internet-of-things.pdf | |
| http://www.oreilly.com/data/free/files/analyzing-the-analyzers.pdf | |
| http://www.oreilly.com/data/free/files/architecting-data-lakes.pdf | |
| http://www.oreilly.com/data/free/files/being-a-data-skeptic.pdf | |
| http://www.oreilly.com/data/free/files/big-data-analytics-emerging-architecture.pdf |
| #!/usr/bin/env bash | |
| function __tc_encode { | |
| # Only unicode characters are not supported | |
| echo -n "$1" | sed "s/\([|']\)/\|\1/g; s/\[/\|\[/g; s/\]/\|\]/g; s/\r/\|r/g;" | sed ':a;N;$!ba;s/\n/|n/g' | |
| } | |
| function __tc_message { | |
| echo "##teamcity[message text='$(__tc_encode "$2")' status='${1:-NORMAL}']" | |
| } | |
| function __tc_simple { |
| import logging | |
| import random | |
| import time | |
| from systemd.journal import JournaldLogHandler | |
| # get an instance of the logger object this module will use | |
| logger = logging.getLogger(__name__) | |
| # instantiate the JournaldLogHandler to hook into systemd | |
| journald_handler = JournaldLogHandler() |