Skip to content

Instantly share code, notes, and snippets.

# Thanks to this post:
# http://blog.ikato.com/post/15675823000/how-to-install-consolas-font-on-mac-os-x
which cabextract>/dev/null || which brew>/dev/null || { echo Please install Homebrew!; exit 1; }
install() {
local url=https://sourceforge.net/projects/mscorefonts2/files/cabs/PowerPointViewer.exe
which cabextract>/dev/null || brew install cabextract
mkdir -P ~/tmp/consolas \
&& pushd ~/tmp/consolals \
&& curl -LO "${url}" \
@nathansgreen
nathansgreen / brewbootstrap.sh
Last active October 7, 2016 05:44
Homebrew Bootstrap
#!/usr/bin/env bash
sudo xcodebuild -license
sudo xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask
brew tap homebrew/dupes
brew tap homebrew/fuse
brew tap homebrew/headonly
rem re-run if your system failed the upgrade compatibility check
rem if vmware's VGA driver is the problem, delete the driver, reboot, then run
schtasks.exe /Run /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
yum install python-devel libffi-devel openssl-devel
rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
yum install python-pip
@nathansgreen
nathansgreen / inst.sh
Last active November 4, 2015 19:46
Homebrew install Python 2.7.8 with SSLv2 support
cd /usr/local/Library/Formula
# remove no-ssl2 from configure options
vi openssl.rb
brew install openssl --universal
# verify support
/usr/local/opt/openssl/bin/openssl ciphers -ssl2
# I install a separate python 2.7.8 so I can switch between versions as-needed
git checkout 9c9664e -- python.rb
brew install python --universal --with-brewed-openssl
@nathansgreen
nathansgreen / javap_output
Last active August 29, 2015 14:03
Java 8 ConcurrentHashMap.keySet() bytecode incompatibility
// In Java 8, ConcurrentHashMap backward compatibility was broken by changing to a covariant return type
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String...);
Code:
0: new #2 // class java/util/TreeSet
@nathansgreen
nathansgreen / ProxyTest.java
Last active June 16, 2022 19:07
java.lang.reflect.Proxy over Annotation
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;