Skip to content

Instantly share code, notes, and snippets.

View maciej's full-sized avatar

Maciej Biłas maciej

View GitHub Profile
import java.io.DataInputStream
import org.roaringbitmap.buffer.MutableRoaringBitmap
object RankBug {
def main(args: Array[String]): Unit = {
val in = new DataInputStream(this.getClass.getClassLoader.getResourceAsStream("buggy-rank.bitmap"))
try {
val bitmap = new MutableRoaringBitmap()
@maciej
maciej / transfer.fish
Last active December 6, 2016 10:58 — forked from nl5887/transfer.fish
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@maciej
maciej / keybase.md
Created July 16, 2016 21:43
keybase.md

Keybase proof

I hereby claim:

  • I am maciej on github.
  • I am maciejb (https://keybase.io/maciejb) on keybase.
  • I have a public key whose fingerprint is 10D3 18C7 AC85 09E9 D195 B01D 3813 29FE 73EB DF69

To claim this, I am signing this object:

@maciej
maciej / DockerMachine.scala
Last active June 13, 2016 11:44
Scala utilities
import scala.util.Try
import sys.process._
object DockerMachine {
lazy val address: String = Try("docker-machine ip".!!(ProcessLogger(_ => ())).trim).getOrElse("127.0.0.1")
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maciej
maciej / snippets.md
Last active November 30, 2015 08:50
Snippets

Snippet collection

Various script and code snippets I collected or created

Docker

Remove all exited containers

docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs docker rm
import com.softwaremill.thegarden.lawn.base.StringExtensions._
trait SnakeCaseJsonProtocol extends DefaultJsonProtocol {
override protected def extractFieldNames(classTag: ClassTag[_]) = super.extractFieldNames(classTag).map {_.underscore}
override protected def fromField[T](value: JsValue, fieldName: String)(implicit reader: JsonReader[T]) =
super.fromField(value, fieldName.camelCase)(reader)
}
jstack -l 81427
2015-06-03 13:36:09
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode):
"Attach Listener" #36 daemon prio=9 os_prio=31 tid=0x00007fbb9e816800 nid=0x5507 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
@maciej
maciej / dpw.json
Created March 13, 2015 15:24
dane po warszawsku
{
"values": [
{
"key": "tabor",
"value": "T"
},
{
"key": "linia",
"value": "11"
},
@maciej
maciej / jh.fish
Created October 20, 2014 23:20
Utility to quickly change the JAVA_HOME in OSX
function jh
if test -e /usr/libexec/java_home
set _jh (/usr/libexec/java_home -v 1.$argv)
if test -n $_jh
echo "Setting JAVA_HOME to $_jh"
set -gx JAVA_HOME $_jh
else
echo "Could not find java version $argv"
end
else