Skip to content

Instantly share code, notes, and snippets.

View salomvary's full-sized avatar

Márton Salomváry salomvary

View GitHub Profile
import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import scala.collection.JavaConversions._
val mapper = new ObjectMapper()
mapper.registerModule(DefaultScalaModule)
mapper.configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, true)
mapper.readValue("""{"bar":{"title":"hello"}}""", classOf[Map[String, Any]])
@salomvary
salomvary / bootstrap-gh-pages.sh
Created February 24, 2016 20:36
Bootstrapping custom GitHub pages
git checkout --orphan gh-pages
git rm -rf .
git show master:README.md > README.md
cat > index.html <<END
---
---
<!doctype html>
<body>
{% capture readme %}{% include_relative README.md %}{% endcapture %}
{{ readme | markdownify }}
@salomvary
salomvary / .ctags
Last active July 11, 2016 14:43
ctags for Ruby and Scala
-R
--languages=ruby
--exclude=.git
const {app, BrowserWindow} = require('electron')
app.on('ready', () => {
const win = new BrowserWindow()
win.loadURL('file://some/local/file.html')
// or
win.loadURL('http://example.com')
})
@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:
@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 / 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] = ???
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 / 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

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