Skip to content

Instantly share code, notes, and snippets.

View thebaer's full-sized avatar
🎯
Focusing

Matt Baer thebaer

🎯
Focusing
View GitHub Profile
@thebaer
thebaer / renamer.sh
Last active August 29, 2015 14:05
Standardizes image file names (especially from iOS land) to be usable as Android resources.
#!/bin/bash
# Standardizes image file names to be usable as Android resources.
# Gotta have some parameters to continue
if [ -z "$1" ]; then
echo "usage: renamer.sh file [file2...]"
echo
exit 1
fi
@thebaer
thebaer / normalizeicons.sh
Created September 1, 2014 04:53
Quickly make image(s) a given dimension by changing canvas size, not scaling.
#!/bin/bash
# Make the given file(s) the given dimension, by extending the canvas, rather
# than scaling. Made especially for PNGs, since it makes the background
# transparent and all. This programmer in particular has found it useful for
# different-sized icons that end at their exact boundaries, causing headaches
# when developing Android apps.
# Name some args
FINALSIZE=$1
@thebaer
thebaer / .welcome.sh
Last active August 29, 2015 14:14
A little script for welcoming you to your newly-opened terminal. Targeted at Ubuntu.
#!/bin/bash
BLUE="\033[0;34m"
LBLUE="\033[1;34m"
GRAY="\033[1;30m"
NC="\033[00m"
spacing=" $GRAY█$NC "
case $(date +%u) in
avgStr := strings.TrimRight(fmt.Sprintf("%.2f", avg), "0")
avgStr = strings.TrimRight(avgStr, ".")

Keybase proof

I hereby claim:

  • I am thebaer on github.
  • I am is (https://keybase.io/is) on keybase.
  • I have a public key whose fingerprint is CEA0 00FB DC41 EF11 E741 4094 9C4C E3A2 7D62 A6FB

To claim this, I am signing this object:

@thebaer
thebaer / num.inp.detect.js
Created June 22, 2012 14:57
Detects which method was used to change the value in an HTML5 number input (clicking to increment or entering a number)
var key = false;
var inp = false;
var click = false;
// Get the input method
$('#inp').bind('input keypress mousedown paste', function(e) {
$('#inp').after('<br>' + e.type);
if (e.type == 'input') {
inp = true;
} else if (e.type == 'keypress' || e.type == 'paste') {
key = true;
@thebaer
thebaer / facebook.css
Created November 29, 2012 16:09
Hide Facebook chat, some sidebar groups, and requests
/* Hide chat sidebar */
#pagelet_sidebar {
display: none;
}
.sidebarMode .fbx #globalContainer, .sidebarMode .fbx #pageHead, .sidebarMode #blueBar #pageHead {
padding-right: 0px;
}
/* Hide left sidebar groups: Ads, Apps */
#adsNav, #appsNav {
Verifying that +baer is my blockchain ID. https://onename.com/baer
@thebaer
thebaer / help.json
Created April 24, 2013 12:06
LunchTable's Help / FAQ file.
{
"Getting Started": [
{
"slug": "what",
"question": "What is LunchTable?",
"answer": "<p>LunchTable is a software platform built for group communication.</p>"
},
{
"slug": "how",
"question": "How does it work?",
@thebaer
thebaer / .bashrc
Last active December 31, 2015 03:49
Initialize a new server with the essentials.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace