Skip to content

Instantly share code, notes, and snippets.

View IntermHaskell.hs
-- https://haskell.fpcomplete.com/user/DanBurton/20-intermediate-exercises
-- Originally from http://blog.tmorris.net/posts/20-intermediate-haskell-exercises/
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)
}
}
View keyrepeat.shell
# 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
alissapajer / packinglist
Created Oct 8, 2012
Rainier packing list!
View packinglist
backpack
pack cover
hiking poles
sleeping bag
sleeping pad
tent
water bottles
camelback
water purification system
View vim_shortcuts.txt
MOVEMENT
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
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
alissapajer / osx-mongodb-rlimits-fix.md
Created May 17, 2016 — forked from tamitutor/osx-mongodb-rlimits-fix.md
Fix Mongodb "soft rlimits" Warning On Mac OS X (Yosemite)
View osx-mongodb-rlimits-fix.md

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 https://github.com/basho/basho_docs/issues/1402)

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

...containing:

View keybase.md

Keybase proof

I hereby claim:

  • I am alissapajer on github.
  • I am alissapajer (https://keybase.io/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
alissapajer / Notes.md
Created Apr 1, 2019 — forked from chrisvest/Notes.md
PrintCompilation on different versions of HotSpot VM
View Notes.md

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 rednaxelafx@gmail.com

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="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" rel="dct:type

View quick-tips-optimizing-jvm.md

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