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 / 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)
@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 / 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 / untitled.html
Created August 14, 2015 06:50
untitled.html
<!doctype html>
<html>
<head>
<title>Untitled</title>
</head>
<body>
</body>
</html>
@salomvary
salomvary / .ctags
Last active August 29, 2015 14:27
Ruby for VIM
-R
--languages=ruby
--exclude=.git
--exclude=log
@salomvary
salomvary / leaflet-polyline.markdown
Last active September 15, 2015 21:08
Evaluating Leaflet PolyLine Drawing Plugins

Evaluating Leaflet PolyLine Drawing Plugins

Criteria

  • Small footprint
  • Decent code
  • Active development
  • Touch support
  • Drawing a new line
  • Editing mid-points of an existing line
  • Continuing an existing line
@salomvary
salomvary / curl-header.sh
Last active September 22, 2015 11:42
curl to print out the value of a given header
$ curl -sI 'http://google.com' | tr -d '\r' | awk 'BEGIN {FS=": "}/^Location/{print $2}'
http://www.google.de/?gfe_rd=cr&ei=JDsBVrqxNs7j8wfo_5OICw
@salomvary
salomvary / PageLinks.java
Created October 14, 2015 13:03
PageLinks.java
@salomvary
salomvary / .ctags
Last active July 11, 2016 14:43
ctags for Ruby and Scala
-R
--languages=ruby
--exclude=.git
@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 }}