The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const matrizInimigoGrande = [ | |
[0,0], | |
[400,0], | |
[800,0], | |
[1200,0], | |
[1600,0], | |
[0,400], | |
[400,400], | |
[800,400], | |
[1200, 400], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ogr2ogr -s_srs EPSG:4326 -t_srs "+proj=latlong +pm=0" paises_0.shp paises.shp | |
ogr2ogr -s_srs EPSG:4326 -t_srs "+proj=latlong +pm=-360" paises_360.shp paises.shp | |
ogr2ogr -update -append paises_360.shp paises_0.shp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Specify a directory for plugins | |
call plug#begin('~/.local/share/nvim/plugged') | |
" Colorizer A plugin to color colornames and codes | |
Plug 'chrisbra/Colorizer' | |
" vim-markdown-composer An asynchronous markdown preview plugin for Vim and Neovim | |
function! BuildComposer(info) | |
if a:info.status != 'unchanged' || a:info.force | |
if has('nvim') |
The difference is that hashing is a one way function, where encryption is a two-way function.
Therefore, when a user submits a password, you don't decrypt your stored hash, instead you perform the same bcrypt operation on the user input and compare the hashes. If they're identical, you accept the authentication.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" A simple decorator that times the duration of a function's execution. More info on Decorators at https://pythonconquerstheuniverse.wordpress.com/2009/08/06/introduction-to-python-decorators-part-1/""" | |
import timeit | |
def timer(function): | |
def new_function(): | |
start_time = timeit.default_timer() | |
function() | |
elapsed = timeit.default_timer() - start_time | |
print('Function "{name}" took {time} seconds to complete.'.format(name=function.__name__, time=elapsed)) | |
return new_function() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/anaconda2/envs/py360/bin/python | |
from datetime import datetime | |
from json import dump | |
from os import walk | |
from os.path import join | |
import logging | |
import re | |
def search_dir(root, target='.git', pattern=re.compile(r'^\.git|[\w\d\s!@#$%^&*()_+\-=\[\]{};\':"\\|,<>\/?]+$'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import pandas.io.sql as sqlio | |
import psycopg2 | |
conn = psycopg2.connect("host='{}' port={} dbname='{}' user={} password={}".format(host, port, dbname, username, pwd)) | |
sql = "select count(*) from table;" | |
dat = sqlio.read_sql_query(sql, conn) | |
conn = None |
NewerOlder