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)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#! /usr/bin/python
"""
brute force get title of web page
usage: getTitle.py url
Gordon Meyer January 1, 2013
www.gordonmeyer.com
"""
# modules used
import urllib2, urlparse, string, os
@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 / 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 / inlinefootnotes.rb
Created October 1, 2012 20:21
A script for writing Day One footnotes inline.
#!/usr/bin/env ruby
def e_sh(str)
str.to_s.gsub(/(?=[^a-zA-Z0-9_.\/\-\x7F-\xFF\n])/n, '\\')
end
input = STDIN.read
footnotes = input.scan(/\(\*(.*?)\*\)/m)
# existing = input.scan(/^\[\^fn(\d+)\]: /i)
@agmarrugo
agmarrugo / gist:3182270
Created July 26, 2012 14:11
Moving referenced images in a markdown file to another folder
for f in `grep -o '\..*png' myreport.txt`; do cp $f ../Public/myproject/ ; done
@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