Skip to content

Instantly share code, notes, and snippets.

View jimschubert's full-sized avatar
🎯
Always here to help.

Jim Schubert jimschubert

🎯
Always here to help.
  • Richmond, VA
View GitHub Profile
@jimschubert
jimschubert / swagger-codegen-maven-plugin-example.md
Created May 4, 2017 20:11
Swagger Codegen Maven Plugin standalone example
  1. Save as pom.xml to an empty directory.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>IO.Swagger.Petstore</groupId>
    <artifactId>io.swagger.petstore</artifactId>
@jimschubert
jimschubert / .gitignore
Last active November 16, 2023 04:16
Prototyping a Flags/Bitmasks implementation in Kotlin 1.1.1
META-INF/
*.class
@jimschubert
jimschubert / mime.csv
Created March 17, 2017 20:26
List of more common mime types from MDN, in CSV and TSV
Name MIMEType Extension Description
aac audio/aac .aac AAC audio file
abw application/x-abiword .abw AbiWord document
arc application/octet-stream .arc Archive document (multiple files embedded)
avi video/x-msvideo .avi AVI: Audio Video Interleave
azw application/vnd.amazon.ebook .azw Amazon Kindle eBook format
bin application/octet-stream .bin Any kind of binary data
bz application/x-bzip .bz BZip archive
bz2 application/x-bzip2 .bz2 BZip2 archive
csh application/x-csh .csh C-Shell script
@jimschubert
jimschubert / swagger.sh
Last active March 26, 2018 01:35
Quick script for running swagger codegen cli directly
#!/bin/bash
ver=2.3.1
jar=swagger-codegen-cli-$ver.jar
md5=c838c266b80401ecd43521890b4abea8
repo="http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/$ver/$jar"
if [ ! -f $jar ]; then
echo "[info] downloading $PWD/$jar from $repo" 1>&2
if ! curl --location --silent --fail --remote-name $repo -o $jar; then
@jimschubert
jimschubert / pull-request-template.md
Last active December 19, 2016 19:06 — forked from Lordnibbler/pull-request-template.md
Sample Pull Request Template

Description

Related PRs

Todos

# <type>(<scope>): <subject>
#
# <body>
#
# <footer>
#
# ** TYPES **
# feat (new feature)
# fix (bug fix)
# docs (changes to documentation)
@jimschubert
jimschubert / Mac1010limits.sh
Created December 12, 2016 20:44 — forked from glickbot/Mac1010limits.sh
Enables setting Mac OS 10.10 Yosemite open file limit to 65535 & max procs to 2048
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
cat <<MAXFILES > /Library/LaunchDaemons/limit.maxfiles.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@jimschubert
jimschubert / try.patch
Created December 12, 2016 03:24
Try implementation in Kotlin that I've ditched but don't want to lose
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 43ca251..9db3760 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Dec 05 21:26:08 EST 2016
+#Sun Dec 11 10:08:31 EST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
@jimschubert
jimschubert / Markdown-JavaScript.markdown.js
Last active September 24, 2023 13:31
DataGrip (IntelliJ) output SQL results to Markdown
if (!String.prototype.repeat) {
// polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
String.prototype.repeat = function(count) {
'use strict';
if (this == null) {
throw new TypeError('can\'t convert ' + this + ' to object');
}
var str = '' + this;
count = +count;
if (count != count) {
@jimschubert
jimschubert / md5sum.sh
Created May 10, 2016 13:43
Bash shell function to verify md5sum
#!/bin/env bash
function md5sum {
md5 "$1" | cut -f2 -d'=' | tr -cd "[:alnum:]"
}
function md5sum.verify {
if [[ ( -f "$1" ) || ( ! -f "$2" ) || ( $(echo "$1") == "" ) ]] ; then
echo 'usage: md5sum.verify checksum filename';
else