Skip to content

Instantly share code, notes, and snippets.

View jeremyboggs's full-sized avatar

Jeremy Boggs jeremyboggs

View GitHub Profile
# For Mac
.DS_Store
# For VIM
.*.sw*
*~
# SASS stuff
.sass-cache
# For Mac
.DS_Store
# For VIM
.*.sw*
*~
# SASS stuff
.sass-cache
@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.