Skip to content

Instantly share code, notes, and snippets.

View agmarrugo's full-sized avatar

Andres Marrugo agmarrugo

View GitHub Profile
@agmarrugo
agmarrugo / coauthored_articles_code.py
Created September 25, 2023 21:41
This Python program analyzes a dataset of academic articles and a list of students to identify co-authored articles. It aims to find which articles were co-authored by students from a specific Master's program and count them on a yearly basis.
import pandas as pd
from fuzzywuzzy import fuzz
import re
def filter_by_identifier(name):
match = re.search(r'\((\d+)\)', name)
if match:
identifier = match.group(1)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@agmarrugo
agmarrugo / jekyllpre.rb
Created October 14, 2015 05:35 — forked from ttscoff/jekyllpre.rb
Marked Custom Processor for Jekyll/Octopress previews with img/gist Liquid tags
#!/usr/bin/ruby
# encoding: utf-8
# Version 1
#
# Example custom processor for use with Marked <http://markedapp.com> and Jekyll _posts
# It's geared toward my personal set of plugins and tags, but you'll get the idea.
# It turns
# {% img alignright /images/heythere.jpg 100 100 "Hey there" "hi" %}
# into
# <img src="../images/heythere.jpg" alt="Hey there" class="alignright" title="hi" />
@agmarrugo
agmarrugo / grades2csv.py
Last active October 20, 2015 03:39
Reads a text file with grades and comments, and produces a csv file.
#! /usr/local/bin/python
# -*- coding: utf-8 -*-
import re
import csv
import argparse
class REMatcher(object):
""" A little class that returns the boolean result of calling match,
and retains the matched groups for subsequent retrieval.
@agmarrugo
agmarrugo / whitelineslink.py
Last active September 26, 2015 04:54
A script for processing whitelinesLink images
@agmarrugo
agmarrugo / gist:73d244c1f04b4f85f443
Last active August 29, 2015 14:25 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master

Python version of the MATLAB code in this Stack Overflow post: http://stackoverflow.com/a/18648210/97160

The example shows how to determine the best-fit plane/surface (1st or higher order polynomial) over a set of three-dimensional points.

Implemented in Python + NumPy + SciPy + matplotlib.

quadratic_surface

@agmarrugo
agmarrugo / openmotif-log.sh
Created July 1, 2015 19:16
OpenMotif 2.3.4 successful install log on Yosemite OS X 10.10.3
Andress-MacBook-Pro:cv Andre$ brew install https://gist.githubusercontent.com/steakknife/60a39a32ae84e12238a2/raw/openmotif.rb
######################################################################## 100.0%
==> Installing openmotif dependency: libpng
==> Downloading https://homebrew.bintray.com/bottles/libpng-1.6.17.yosemite.bott
######################################################################## 100.0%
==> Pouring libpng-1.6.17.yosemite.bottle.tar.gz
🍺 /usr/local/Cellar/libpng/1.6.17: 17 files, 1.2M
==> Installing openmotif
==> Downloading https://downloads.sourceforge.net/project/motif/Motif%202.3.4%20
==> Downloading from http://colocrossing.dl.sourceforge.net/project/motif/Motif%
"""
This code takes two screenshots from the camera roll combines them into one image and saves the new image to the camera roll.
This is adapted from Federico Viticci's blog post at:
http://www.macstories.net/stories/automating-ios-how-pythonista-changed-my-workflow/
It removes the option to change which picture is where, automatically assigning the first one chosen as the leftmost image.
It also removes the necessity to copy the images to the clipboard outside of Pythonista using the new photos library in version 1.3. Finally, it removes the clipboard output.
"""
import photos
@agmarrugo
agmarrugo / ago.py
Created December 8, 2014 02:38
ago.py
#!/usr/bin/python
from datetime import date
import sys
now = date.today()
inputDate= sys.argv[1].split()
day = int(inputDate[0])
month = int(inputDate[1])