Skip to content

Instantly share code, notes, and snippets.

Matthew Andersen mattandersen

Block or report user

Report or block mattandersen

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
@mattandersen
mattandersen / bash_script_template.sh
Last active Aug 21, 2018
Template for Multi Command Bash Scripts
View bash_script_template.sh
#!/usr/bin/env bash
# This is a template which provides a number of utilities I find useful when building a Bash script.
# It handles the case where one script may perform multiple commands, and that must be determined by arguments.
# Read comments marked with TODO for how to populate the script.
# This template also provides functionality to define and check for verbosity and debuginess, as well as constants which can be used to display color output.
VERBOSE=0
DEBUG=0
View gist:2ec7393c44330c48e7e6e89721670f07
ssconvert - Part of gnumeric, converts Excel spreadsheets to CSV (or vis-a-versa) from CLI
@mattandersen
mattandersen / update_jetbrains_formulas.bash
Created Jun 18, 2017
Bash script to update the homebrew-linuxbinary formulas
View update_jetbrains_formulas.bash
#!/bin/bash
FORMULA="clion.rb \
datagrip.rb \
intellij-idea-ce-no-jdk.rb \
intellij-idea-ce.rb \
intellij-idea-no-jdk.rb \
intellij-idea.rb \
jetbrains-toolbox.rb \
phpstorm.rb \
@mattandersen
mattandersen / png_to_mp4.sh
Created Apr 28, 2017
PNGs frames to MP4 Playable on iOS
View png_to_mp4.sh
ffmpeg -framerate 30 -i images%03d.png -vf format=yuv420p -profile:v high -level 4.2 output.mp4
View hdpi.sh
#!/usr/bin/env bash
# Enable / Disable 2x Scaling for GNOME easily and quickly.
main() {
if [ -z "$1" ]; then
usage
exit 1
fi
SCALE_FACTOR=0
TEXT_SCALING_FACTOR="1.0"
@mattandersen
mattandersen / Enpass
Last active May 3, 2017
HiDPI Hacks for Linux
View Enpass
Add the following before the last line in the `runenpass.sh` of the Enpass installation directory
export QT_AUTO_SCREEN_SCALE_FACTOR=$(gsettings get org.gnome.desktop.interface scaling-factor | cut -d " " -f 2)
@mattandersen
mattandersen / JSON.js
Created Jul 26, 2016
JSON Data Extractor for the IntelliJ IDEA Platform
View JSON.js
function eachWithIdx(iterable, f) { var i = iterable.iterator(); var idx = 0; while (i.hasNext()) f(i.next(), idx++); }
function mapEach(iterable, f) { var vs = []; eachWithIdx(iterable, function (i) { vs.push(f(i));}); return vs; }
OUT.append(JSON.stringify( mapEach(ROWS, function(row, row_idx) {
var r = {};
eachWithIdx(COLUMNS, function(col, col_idx) { r[ col.name() ] = row.value(col); });
return r;
})));
@mattandersen
mattandersen / PHP Array.php.js
Created Mar 15, 2016
PHP Array Data Extractor for the IntelliJ IDEA Platform
View PHP Array.php.js
function eachWithIdx(iterable, f) { var i = iterable.iterator(); var idx = 0; while (i.hasNext()) f(i.next(), idx++); }
function mapEach(iterable, f) { var vs = []; eachWithIdx(iterable, function (i) { vs.push(f(i));}); return vs; }
function escape(str) {
str = com.intellij.openapi.util.text.StringUtil.escapeXml(str);
return str;
}
function quote(str) {
return '"' + str + '"';
@mattandersen
mattandersen / brew-install.sh
Last active Oct 5, 2015
Script to Install My Required Software with Brew
View brew-install.sh
#!/bin/sh
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew install bash
brew install wget
brew install go
brew install node
brew install base64
brew install git
brew install subversion
@mattandersen
mattandersen / jshint.weak.conf
Created Mar 26, 2015
Extremely Lenient JSHint Configure File. Using this you can enable only one or two flags you're specifically targeting at the time.
View jshint.weak.conf
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : false, // true: Require {} for every new block or scope
You can’t perform that action at this time.