Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / gist:4174858
Created November 30, 2012 09:52
exhibit JIT compile bug in jdk 1.6.0_21
import java.lang.reflect.Field;
import java.util.Arrays;
import sun.misc.Unsafe;
public class Inline
{
private static final int BASE_LENGTH = 7;
private static final int[] LENGTHS = new int[] {1, 2, 3, 4, 5, 6};
private static final Unsafe UNSAFE;
@framp
framp / no-babel-thx.sh
Created August 26, 2016 13:48
Sets of regex replacements to get rid of ES6 imports/exports
#import
find . -name 'node_modules' -prune -o -type f -name '*.js' \
| xargs perl -i.bak -wpe 's/import(.*)from\s*'\''(.*)'\''/const$1= require('\''$2'\'')/g'
#export default
find . -name 'node_modules' -prune -o -type f -name '*.js' \
| xargs perl -i.bak -wpe 's/export default/module.exports =/g'
#export const
find . -name 'node_modules' -prune -o -type f -name '*.js' \
| xargs perl -i.bak -wpe 's/export const\s*([^\s]*)/const $1 = exports.$1/g'
#export function