Skip to content

Instantly share code, notes, and snippets.

View IntermHaskell.hs
-- Originally from
class Fluffy f where
furry :: (a -> b) -> f a -> f b
-- Exercise 1
-- Relative Difficulty: 1
instance Fluffy [] where
furry = fmap
View Why ConcurrentHashMap
import java.util.concurrent.ConcurrentHashMap
object Why {
val data = new ConcurrentHashMap[Int, String]
def update(int: Int, str: String): Unit = {
data.put(int, str)
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
alissapajer / packinglist
Created Oct 8, 2012
Rainier packing list!
View packinglist
pack cover
hiking poles
sleeping bag
sleeping pad
water bottles
water purification system
View vim_shortcuts.txt
j k h l - up down left right (by character)
b w - left right (by word)
gg G - bof eof
0 $ - bol eol
^ - bot
shift-% - jump to matching Klammer
ctrl-e - up one line
ctrl-y - down one line
alissapajer / gist:50c912d739346c1f00dd
Last active Apr 1, 2016
Contravariant and Covariant Functors and Variance of Types over their Type Parameters
View gist:50c912d739346c1f00dd
* Exercises explaining covariant and contravariant functors.
* Additionally exercises explaining variance of types over their type parameters.
* Implement the `???` functions. Are all implementable?
trait Functors {
alissapajer /
Created May 17, 2016 — forked from tamitutor/
Fix Mongodb "soft rlimits" Warning On Mac OS X (Yosemite)

If you are seeing Mongo soft rlimits warnings in your logs, or a WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 when you login to mongo shell via mongo from the commandline, or any mysterious/unexplained mongo connection errors... follow this how-to exactly and it will resolve the issue for you.

(Source of this how to found at

First file: sudo vi /Library/LaunchDaemons/limit.maxfiles.plist



Keybase proof

I hereby claim:

  • I am alissapajer on github.
  • I am alissapajer ( on keybase.
  • I have a public key whose fingerprint is D378 1B6B 4665 571C DD7C 0C64 B9A0 6E42 6439 2BD1

To claim this, I am signing this object:

alissapajer /
Created Apr 1, 2019 — forked from chrisvest/
PrintCompilation on different versions of HotSpot VM

About PrintCompilation

This note tries to document the output of PrintCompilation flag in HotSpot VM. It was originally intended to be a reply to a blog post on PrintCompilation from Stephen Colebourne. It's kind of grown too big to fit as a reply, so I'm putting it here.

Written by: Kris Mok

Most of the contents in this note are based on my reading of HotSpot source code from OpenJDK and experimenting with the VM flags; otheres come from HotSpot mailing lists and other reading materials listed in the "References" section.

Creative Commons License
This <span xmlns:dct="" href="" rel="dct:type


Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea