Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Maxim Novak maximn

🎯
Focusing
Block or report user

Report or block maximn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@maximn
maximn / BitMaskExtensions.scala
Created Nov 10, 2015
Bit array string representation of a Scala BitSet
View BitMaskExtensions.scala
implicit class BitMaskExtensions(bitSet: BitSet) {
def toBitArrayString: String = {
val seq = (0 to bitSet.max) map { x => if (bitSet.contains(x)) "1" else "0"}
"[" + seq.mkString(",") + "]"
}
}
@maximn
maximn / assert
Last active Feb 22, 2018
Scala preconditions
View assert
val rnd = Math.random()
val n = Math.abs(rnd)
assert(n > 0)
@maximn
maximn / java-adapter-general.java
Last active Dec 30, 2015
Scala adapter pattern - maxondev.com
View java-adapter-general.java
public interface Adaptee {
void doAdaptee();
}
public interface Adaptor {
void doAdaptor();
}
class Client{
private final Adaptor adaptor;
@maximn
maximn / extjs-tooltip-hideEmpty.js
Created May 19, 2013
A patch for ExtJS 4.2 Ext.tip.ToolTip It hides empty tooltips (the default behavior is to show empty border)
View extjs-tooltip-hideEmpty.js
tips: {
// ...
renderer: function (storeItem, item) {
if (/* want to hide condition ... */) {
this.update();
return;
}
// ... the code for regualr tips we want to show
},
listeners:
You can’t perform that action at this time.