Skip to content

Instantly share code, notes, and snippets.

Andres Marrugo agmarrugo

Block or report user

Report or block agmarrugo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@agmarrugo
agmarrugo / jekyllpre.rb
Created Oct 14, 2015 — forked from ttscoff/jekyllpre.rb
Marked Custom Processor for Jekyll/Octopress previews with img/gist Liquid tags
View jekyllpre.rb
#!/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 Oct 20, 2015
Reads a text file with grades and comments, and produces a csv file.
View grades2csv.py
#! /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 Sep 26, 2015
A script for processing whitelinesLink images
View whitelineslink.py
@agmarrugo
agmarrugo / gist:73d244c1f04b4f85f443
Last active Aug 29, 2015 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
View gist:73d244c1f04b4f85f443
git fetch --all
git reset --hard origin/master
git pull origin master
View README.md

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 Jul 1, 2015
OpenMotif 2.3.4 successful install log on Yosemite OS X 10.10.3
View openmotif-log.sh
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%
View Create image of side by side screeshots.py
"""
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
View 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])
@agmarrugo
agmarrugo / duplicate_papers.py
Created Oct 18, 2014
A script for detecting unique and duplicate values from a csv file.
View duplicate_papers.py
import csv
with open('papers.csv','r') as f:
sheet = csv.reader(f)
papers = []
for row in sheet:
# Every row is a list, thus I concatenate all to form a single list
papers = papers + row
# remove blank spaces
papers = filter(None,papers)
@agmarrugo
agmarrugo / accept_letter.py
Last active Aug 29, 2015
Generate acceptance letters for a list of papers downloaded from Easy Chair
View accept_letter.py
# This Python file uses the following encoding: utf-8
import re, subprocess, os, shlex
from string import Template
class REMatcher(object):
def __init__(self, matchstring):
self.matchstring = matchstring
def match(self,regexp):
You can’t perform that action at this time.