Skip to content

Instantly share code, notes, and snippets.

View iMerica's full-sized avatar

Michael iMerica

  • Austin, Texas
View GitHub Profile
@iMerica
iMerica / remove_old_images.sh
Last active March 15, 2018 17:09
Delete Docker Images that are older than N days
# Example: `remove_old_images 30` // Deletes all Docker Images 30 days or older
function remove_old_images() {
if [ $# -eq 0 ]
then
echo "Pass in the number of days"
exit 0
fi
docker images --format '{{.ID}} {{.CreatedAt}}' | \
awk '{print $1 " " $2 }' | \

Keybase proof

I hereby claim:

  • I am imerica on github.
  • I am imichael (https://keybase.io/imichael) on keybase.
  • I have a public key ASAK1tg_-_AO3dIyv2usYyUeDQldYkHaLoP97ljTp7LgIgo

To claim this, I am signing this object:

@iMerica
iMerica / pycharm.vmoptions
Created July 21, 2017 01:00
PyCharm VM Options
-Xms2048m
-Xmx2048m
-XX:ReservedCodeCacheSize=2048m
-XX:+UseCompressedOops
-Dide.no.platform.update=true
@iMerica
iMerica / gcache.js
Created May 16, 2016 18:25
View current page from Google Cache
javascript:void((function(){var%20a=window.location.href.replace(/^http%5C:%5C/%5C/(.*)$/,"$1");location.href="http://www.google.com/search?q=cache:"+escape(a);})())
@iMerica
iMerica / facebook_filter.user.js
Last active October 3, 2015 17:39
Facebook Filter
// ==UserScript==
// @name Facebook filter
// @namespace iMerica
// @description Hides Facebook posts you don't want to see.
// @include http://www.facebook.com/*
// @include https://www.facebook.com/*
// ==/UserScript==
// Install:
// Step 1: Install TamperMonkey
@iMerica
iMerica / viscosity-to-ios-connect.rb
Last active July 5, 2023 21:27 — forked from chrisboulton/viscosity-to-ios-connect.rb
Quickly convert all of your Viscosity connections into OVPN configuration files for OpenVPN for iOS (bundles certificates and keys in the files too)
Dir.glob("#{ENV['HOME']}/Library/Application Support/Viscosity/OpenVPN/*/config.conf").each do |file|
certificate_files = ['ca', 'cert', 'key', 'tls-auth']
config_dir = File.dirname(file)
connection_name = nil
new_config = []
File.read(file).lines.each do |line|
line.strip!
if line.start_with?('#viscosity name')
@iMerica
iMerica / frenchpress.md
Last active August 29, 2015 14:17
Perfect French press coffee

How I brew coffee with a French Press

This is the French press routine I've arrived at after experimenting for a while and talking to other coffee aficionados. Am I missing something? Comments welcome!

Requirements

  • French press. I use a Frieling 23oz stainless, but any will do.
  • Measuring cup or food scale.
  • Coarse grain coffee.
  • Food thermometer. I use an infrared thermometer, but a kettle with a built-in thermometer will work too.
require 'date'
require 'koala'
class BirthdayLiker
FACEBOOK_TOKEN = ENV['FB_OAUTH_KEY']
BIRTHDAY_WORDS = %w(birthday bday birfday birth born)
THANKS_OPTIONS = ['Thank you!', 'Thanks!', 'Appreciate it!']
DATE_TIME_FORMAT = '%Y-%m-%d'
def initialize(birthdate, opts={})
@iMerica
iMerica / identify_focus_issue.py
Created February 11, 2014 02:59
Identify which app or process is stealing focus on OSX
#!/usr/bin/python
from AppKit import NSWorkspace
import time
t = range(1,100)
for i in t:
time.sleep(3)
activeAppName = NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName']
print activeAppName
@iMerica
iMerica / .vimrc
Created May 18, 2013 18:54
Michael's VimRC
filetype off
call pathogen#incubate()
call pathogen#helptags()
filetype plugin indent on
set runtimepath^=~/.vim/bundle/ctrlp.vim
syntax enable
set background=light
autocmd VimEnter * NERDTree
set smartindent
set nohlsearch