Skip to content

Instantly share code, notes, and snippets.

View salomvary's full-sized avatar

Márton Salomváry salomvary

View GitHub Profile
@salomvary
salomvary / untitled.html
Created August 14, 2015 06:50
untitled.html
<!doctype html>
<html>
<head>
<title>Untitled</title>
</head>
<body>
</body>
</html>
@salomvary
salomvary / datetime.java
Last active January 21, 2022 23:23
Java 8 Date and Time Parsing and Formatting Microtutorial
import java.time.format.DateTimeFormatter;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
Instant.now();
// java.time.Instant = 2015-08-13T09:28:27.141Z
DateTimeFormatter.ISO_INSTANT.format(Instant.now());
@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 / gist:53da16e4ab13c4c34f53
Created May 15, 2015 09:13
Safari vs. WebView UserAgent
Safari:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/7.1.6 Safari/537.85.15
WebView:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.78.2 (KHTML, like Gecko)
Process: SoundCleod [31653]
Path: /Applications/SoundCleod.app/Contents/MacOS/SoundCleod
Identifier: sc.SoundCleod
Version: 0.17 (0.17)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: SoundCleod [31653]
User ID: 502
Date/Time: 2015-01-12 11:35:35.447 -0500
@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
@salomvary
salomvary / rest-idl.md
Created December 11, 2014 12:07
REST IDL
@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 / Scala❤Java❤JavaScript.scala
Created November 26, 2014 22:00
Scala❤Java❤JavaScript
/**
* Usage:
* scalac Main.scala
* scala com.example.Main
*/
package com.example
import java.util.function.Function
import javax.script.ScriptEngineManager