Skip to content

Instantly share code, notes, and snippets.

View xlbruce's full-sized avatar
💭
Adena plz

Gilson de Paula xlbruce

💭
Adena plz
View GitHub Profile
@j4mie
j4mie / normalise.py
Created August 30, 2010 12:44
Normalise (normalize) unicode data in Python to remove umlauts, accents etc.
# -*- 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
@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ 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
@sweenzor
sweenzor / logtest.py
Created February 9, 2012 19:59
Writing to syslog with Python's logging library
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')
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/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.
"""
@manuholiveira
manuholiveira / CID10.SQL
Last active August 3, 2022 20:25
Carga para inserir todos os registro do CID10
This file has been truncated, but you can view the full file.
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');
INSERT INTO CID10 VALUES ('A02.1','Septicemia por salmonela');
@bdclark
bdclark / hipchat_notify.py
Last active July 29, 2018 17:58
Example python function to notify HipChat room using API version 2
#!/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
@nepsilon
nepsilon / auto-backup-your-configuration-files-with-vim.md
Last active April 27, 2024 00:36
Auto-backup your configuration files with Vim — First published in fullweb.io issue #71

Auto-backup your configuration files with Vim

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
#!/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 {
@trstringer
trstringer / python_logging_to_systemd.py
Created February 5, 2018 13:39
Python logging to systemd
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()