Skip to content

Instantly share code, notes, and snippets.

Spencer Thomas swthomas55

  • Ithaka
  • Ann Arbor, MI
Block or report user

Report or block swthomas55

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
@swthomas55
swthomas55 / slack_scrape.js
Last active May 14, 2018 — forked from Christian-G/slack_scrape.js
Scrape thumbnails from slack
View slack_scrape.js
// Works with the "Workspace Directory"
// 1. Visit https://yourteam.slack.com/team
// 2. Paste this code in your console
// 2a. If there are more members than fit on the screen, you must scroll the directory one screen at a time
// and paste the middle block for each screen-full.
// Then run the last line again to fill 'data'.
// 3. In console: JSON.stringify(data) and copy value. It will contain a map from the Slack username to image URL and
// a relative link to the pop-up with user details. I'm still working on retrieving those details.
// 4. Use this 'jq' script to clean it up (I will work on folding this back into the javascript).
// jq 'with_entries(select(.value.image)|{key,"value":({"image":(.value.image//""|gsub("url\\(";"")|gsub("[)\"]";"";"g")),"link":.value.link})})'
@swthomas55
swthomas55 / JarTest.java
Last active May 17, 2017
Detect corrupted jar files. Eclipse Maven plugin seems prone to creating these.
View JarTest.java
import java.util.jar.JarFile;
import java.io.File;
/**
* List corrupted Jar files.
* <p>
* Usage: java JarTest file ...
* <p>
* Prints the name and a message for each corrupted file.
* <p>
@swthomas55
swthomas55 / git_jira_github_pull_request.sh
Last active Feb 16, 2017 — forked from StevenACoffman/git_jira_github_pull_request.sh
Create Github pull request from JIRA and git
View git_jira_github_pull_request.sh
#!/bin/bash
function safe_curl() {
# call this with a url argument, e.g.
# safecurl.sh "http://myhost.com:8080/eureka/v2/apps/"
# separating the (verbose) curl options into an array for readability
hash curl 2>/dev/null || { echo >&2 "I require curl but it's not installed. Aborting."; exit 1; }
hash jq 2>/dev/null || { echo >&2 "I require jq but it's not installed. Aborting."; exit 1; }
hash sed 2>/dev/null || { echo >&2 "I require sed but it's not installed. Aborting."; exit 1; }
@swthomas55
swthomas55 / git_move.sh
Last active Jan 19, 2016
moves a folder from one git repo into another repo with history intact
View git_move.sh
#!/usr/bin/env bash
# Usage:
# ./git_move.sh git@repo_site.com:/my_repo.git origin/folder/path/ /destination/repo/path/ new/folder/path/
if [ $# -lt 4 ] ; then
echo "Usage: $0 git@repo_site.com:/my_repo.git origin/folder/path/ /destination/repo/path/ new/folder/path/"
exit
fi
@swthomas55
swthomas55 / pom-advance-snapshots.sh
Last active Mar 27, 2018
Manage POM versions in multi-module Maven projects
View pom-advance-snapshots.sh
#! /bin/sh
#
# Usage: pom-advance-snapshots.sh
#
# Update the version of every POM to the next patch version, append the git branch name and SNAPSHOT
# unless the POM already has a SNAPSHOT version.
#
# Thus, version 1.3.4 becomes 1.3.5-branch-SNAPSHOT.
#
# Requires xmlstarlet and maven versions plugin. Invokes maven as "mvn".
You can’t perform that action at this time.