Skip to content

Instantly share code, notes, and snippets.

View salomvary's full-sized avatar

Márton Salomváry salomvary

View GitHub Profile
#!/bin/sh
# Usage:
#
# - Install jq: https://stedolan.github.io/jq/
# - Add this script to your path, eg. to /usr/local/bin
# - Add AWS access key id and secret access key to LastPass
# named "AWS Credentials for my-profile profile"
# - Add "credential_process = awscreds-lpass my-profile" to
# the respective profile in ~/.aws/config
@salomvary
salomvary / settimeout-nashorn.js
Created November 27, 2014 17:55
setTimeout for Nashorn
// Adopted from here: https://gist.github.com/bripkens/8597903
// Makes ES7 Promises polyfill work on Nashorn https://github.com/jakearchibald/es6-promise
// (Haven't verified how correct it is, use with care)
(function(context) {
'use strict';
var Timer = Java.type('java.util.Timer');
var Phaser = Java.type('java.util.concurrent.Phaser');
var timer = new Timer('jsEventLoop', false);
@salomvary
salomvary / gb-vs-uk.markdown
Last active January 21, 2019 19:11
TL;DR: GB vs. UK

Great Britain, United Kingdom and other related stuff

Great Britain

  • Great Britain is an island in Europe.
  • Great Britain refers geographically to the island of Great Britain, politically to England, Scotland and Wales in combination.

United Kingdom

  • The United Kingdom of Great Britain and Northern Ireland, commonly known as the United Kingdom (UK) or Britain, is a sovereign state in Europe [...]

Is Gmail slow in Firefox?

I recently ranted about Gmail being slow in Firefox and decided to investigate and support my claim with numbers.

Here is a video illustrating the perceived speed (I could not capture how slow this sometimes actually gets but still looks slow): https://www.youtube.com/watch?v=yu3KMki-9_w

My perceived annoying slowness looks like this:

  • Open a new Firefox tab with gmail.com
@salomvary
salomvary / add-all.sh
Created December 16, 2014 17:55
Add all jvms to jenv on Mac
#!/bin/bash
/usr/libexec/java_home -V 2>&1 1>/dev/null |
tail -n +2 |
awk -F $'\t' '{ print $3 }' |
xargs -n 1 jenv add
import com.datastax.driver.core.querybuilder.Select;
import org.junit.Test;
import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
import static com.datastax.driver.core.querybuilder.QueryBuilder.select;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
public class QueryBuilderTest {
@salomvary
salomvary / example.scala
Created December 19, 2017 07:39
Parallel Composition of Scala Futures
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
case class Author(id: Long, name: String)
case class Publication(id: Long, authorId: Long, title:String)
case class AuthorPublications(author: Author, publications: List[Publication])
def findAuthor(query: String): Future[Long] = ???
@salomvary
salomvary / continuous.md
Last active October 4, 2017 14:29
Continuous delivery vs integration vs. deployment

"Continuous delivery (CD) is a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time."

"In software engineering, continuous integration (CI) is the practice of merging all developer working copies to a shared mainline several times a day."

"Continuous deployment means that every change is automatically deployed to production. Continuous delivery means that the team ensures every change can be deployed to production but may choose not to do it, usually due to business reasons. In order to do continuous deployment one must be doing continuous delivery."

@salomvary
salomvary / PlayJson.scala
Last active July 9, 2017 16:58
PlayJson Crash Course
import java.time.{Instant, ZonedDateTime}
import play.api.libs.json._
import scala.util.control.NonFatal
/**
* PlayJson Basics
*/
// See type hierarchy (^H) of: