Skip to content

Instantly share code, notes, and snippets.

View davidmpaz's full-sized avatar

David Paz davidmpaz

View GitHub Profile
@davidmpaz
davidmpaz / parseml.py
Created October 28, 2022 15:17 — forked from urschrei/parseml.py
Extract attachments from EML files in the current dir, and write them to the output subdir
#!/usr/bin/env python
"""
2020 update:
- More iterators, fewer lists
- Python 3 compatible
- Processes files in parallel
(one thread per CPU, but that's not really how it works)
"""
@davidmpaz
davidmpaz / prepare-commit-msg.sh
Last active April 27, 2017 12:25 — forked from bartoszmajsak/prepare-commit-msg.sh
Forked to automatically append git commit with a branch name instead prepend
#!/bin/bash
#
# Appends a message to every comit. Usefull for linking issues back
# from bug track systems.
#
# This way you can customize which branches should be skipped when
# apending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
@davidmpaz
davidmpaz / log_reg.py
Last active June 12, 2016 19:30
logistic regression
def logistic_regression(feature_matrix, sentiment, initial_coefficients, step_size, max_iter):
coefficients = np.array(initial_coefficients) # make sure it's a numpy array
for itr in xrange(max_iter):
# Predict P(y_i = +1|x_i,w) using your predict_probability() function
# YOUR CODE HERE
predictions = predict_probability(feature_matrix, coefficients)
# Compute indicator value for (y_i = +1)
indicator = (sentiment==+1)
@davidmpaz
davidmpaz / .gitconfig
Last active September 27, 2015 22:58
git config for future references. Avoiding losts ( after a profile lost :P ) at all cost.
[user]
name = David Moises Paz Reyes
email = davidmpaz@gmail.com
[core]
editor = vim
autocrlf = input
[log]
date = relative