Skip to content

Instantly share code, notes, and snippets.

View jeremyboggs's full-sized avatar

Jeremy Boggs jeremyboggs

View GitHub Profile
@jeremyboggs
jeremyboggs / random.bash
Created May 10, 2017 14:00
Some random bash stuff
## Generate cropped thumbnails of images.
makethumbnails() {
for f in *.jpg; do
filename=$(basename "$f")
extension="${filename##*.}"
filename="${filename%.*}"
convert "$f" -flatten -thumbnail 150x150^ -gravity Center -crop 150x150+0+0 "$filename"_small.jpg;
done
}
@jeremyboggs
jeremyboggs / PinterestScraper.py
Created April 26, 2017 17:41
Scrape locally-saved Pinterest web pages
#!/usr/bin/env python
import os
import sys
import urllib2
from bs4 import BeautifulSoup
# Base URL for Pinterest.
base_url = 'http://pinterest.com'
html_file = sys.argv[1]
@jeremyboggs
jeremyboggs / kards.py
Last active February 2, 2017 20:21
Let's download all the Kim Kardashian articles on US Weekly.
#!/usr/bin/env python
import csv
import urllib2
from bs4 import BeautifulSoup
# Base URL for US Magazine. We'll need this to build the full URL for individual
# articles, since it looks like they use relative URLs.
base_url = 'http://www.usmagazine.com'
@jeremyboggs
jeremyboggs / video_files_for_item.php
Last active February 1, 2017 16:16
Display only video files for a given Omeka item.
<?php
/**
* Display only video files for an Item.
*
* Directly queries the File table for files associated with a given Item.
* Checks the mime_type against an array of video types:
*
* - video/flv
* - video/x-flv
* - video/mp4

Some things I think are important...that I want to articulate better:

  • Understand where your project is, who has access to it, and what those with access can do with it.
  • Retain access—in every possible way—to your own project. Respect this access: Value it, appreciate it, demand it. Be ready, at any time, to take you work with you and deploy it somewhere else. Or, at least, understand what steps would be involved to be able to do that.
  • Work with people who respect that ability. Privilege those sorts of collaborations over those that seek and enforce propriety, isolation, feifdoms, etc.
  • Be ready to articulate what exactly you want your work to do, why you're doing it, and why someone should take time with it.
  • If you can't articulate something, capture that as a question, and take time at some point to consider it.
  • Continue to articulate a lifecycle for your projects. Share this with others, so they know—and can possibly contribute to—your plans.
  • Any engagement with your work, by anyone, is
PROMPT_COMMAND='DIR=`pwd|sed -e "s!$HOME!~!"`; if [ ${#DIR} -gt 30 ]; then CurDir=${DIR:0:12}...${DIR:${#DIR}-15}; else CurDir=$DIR; fi'
PS1="[\$CurDir] "

Is there a label or name for this task?

Converting this:

<?php
echo "<div class=\"db_result_sub_area\"><strong><a href=\"radial_graph.php?person_id=" . $unique_id . "\" target=\"_blank\">Explore Radial Graph</a></strong> (opens in new tab)</div>\n" ;
echo "</div>";
?>
@jeremyboggs
jeremyboggs / git-svn-workflow.md
Last active September 19, 2016 13:59
A Git-SVN workflow that uses both a SVN and Github remote

A Git-SVN Workflow

Scenario: There is a private Subversion repository that is the primary repository for a project. I still need to push, and pull, from that repo, while also using a remote Github repo as the primary place to save ongoing work, issues, etc.

Workflow

  • Subversion repo uses a non-standard layout; No trunk, no branches.
  • Git repo uses a modified version of git-flow.
    • The master branch is a mirror of the Subversion repo. Never commit to that directly. Or, if I do, I immediate do git svn dcommit before makign topic branches.
  • Topic branches for features and bug-fixes, off of master.
<section class="slide jentery-sayers" id="jentery-sayers">
<h1>Remaking Victorian Miniatures: The Speculative Stitches between 2D and 3D</h1>
<p><strong>November 20, 2014<br>
10:00 am–11:30 am<br>
Alderman Library, Room 421</strong></p>
<p>In both digital humanities and popular culture, there is a rapidly growing interest in big data. But in this talk I shift the focus away from amounts of data and toward ways of seeing with computers. In this sense, contemporary computing is more about mediation than media, or more about vision than the visible. Ats of remaking involve serious speculation, and also rely quite heavily on computation to stitch together evidence in the presence of absences. In short, they are matters not of “how many” but of “how this becomes that.”</p>
</section>
<?php
class CustomItemsBrowsePlugin extends Omeka_Plugin_AbstractPlugin
{
protected $_hooks = array(
'items_browse_sql'
);
public function hookItemsBrowseSql($args) {