Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name RemoveMessengerMobileAdBanner
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Removes the annoying ad banner form the top of Messenger.
// @author Midiparse
// @match https://www.messenger.com/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
/* The MIT License (MIT) Copyright (c) 2016 David Szakallas */
/*
Variate an object or array!
Object:
{
bananas: [1, 2],
apples: [3, 4]
}
will become:
@dszakallas
dszakallas / monoids.ipynb
Last active March 14, 2016 20:47
Monoids
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dszakallas
dszakallas / heartbeat.ipynb
Last active September 18, 2016 15:27
Analyzing logging activity
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dszakallas
dszakallas / README.MD
Last active April 13, 2016 21:25
Dynamic graph for weather data

Temperature and humidity observations in Budapest represented as a dynamic graph. Time is represented as a series of frames (points of time).

Improvements:

  • support custom locations
  • hierchical indexing based on time (now it's a flat linked list)
  • gremlinize. Now it's far from optimal with lots of scala collection code interwoven. not good
@dszakallas
dszakallas / README.MD
Last active April 13, 2016 21:32
HdrHistogram footprint

The Gist visualizes the memory footprint for HdrHistogram as calculated from the formula given on their GitHub page.

First graph is when the time is represented in MICROSECONDS. Second graph is when the time is represented in MILLISECONDS.

@dszakallas
dszakallas / Endless.md
Last active January 9, 2018 10:24
Java, Not even once

Endless streams

Disclaimer: This is a satire, and not meant to be taken any more seriously than Java itself. It is not about Java 8 streams. This satire just shows how easy is to define a very complex endless stream functionally in Java using lambdas.

In Scala:

def naturals: Stream[Int] = 0 #:: naturals.map(_ + 1)
@dszakallas
dszakallas / naive-dfs.js
Last active May 30, 2016 19:21
naive dfs
function dfs (vertex, visited) {
if (visited.indexOf(vertex.id) !== -1) { // cut visited nodes
return null
}
if (!vertex.children) { // leaf, return its value
return { id: vertex.id, sum: vertex.value }
} else { // inner node, traverse leaves and aggregate their values
var sum = 0
var childSums = []
for (var child in vertex.children) {
#/usr/bin/env sh
function killport() {
lsof -i :$1 | tail -n 1 | awk '{ printf $2 }' | xargs kill -9
}