Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jgogstad
jgogstad / iterm2-solarized.md
Created December 4, 2017 11:55 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@jgogstad
jgogstad / YamlJsonProtocol.scala
Last active September 21, 2022 21:38
YAML -> JSON -> HOCON -> CaseClass -> HOCON -> JSON -> YAML using Json4s, moultingyaml and pureconfig
import org.json4s._
import org.json4s.JsonAST.{JArray, JNull, JObject, JNumber}
import net.jcazevedo.moultingyaml._
import net.jcazevedo.moultingyaml.DefaultYamlProtocol._
object YamlJsonProtocol extends CollectionFormats {
implicit object JValueYamlFormat extends YamlFormat[JValue] {
override def write(jv: JValue): YamlValue = jv match {

Keybase proof

I hereby claim:

  • I am jgogstad on github.
  • I am jgogstad (https://keybase.io/jgogstad) on keybase.
  • I have a public key ASB2AhHQzjucICqQH8XQZ3P5dY6RVxxpq6g6oaEz1tQuqQo

To claim this, I am signing this object:

root@b77bc7671df6:/# which airflow
/usr/local/bin/airflow
root@b77bc7671df6:/# cat $(!!)
cat $(which airflow)
#!/usr/local/bin/python
# EASY-INSTALL-DEV-SCRIPT: 'apache-airflow===1.9.0-composer','airflow'
__requires__ = 'apache-airflow===1.9.0-composer'
__import__('pkg_resources').require('apache-airflow===1.9.0-composer')
__file__ = '/usr/local/lib/airflow/airflow/bin/airflow'
exec(compile(open(__file__).read(), __file__, 'exec'))
airflow@airflow-scheduler-5469fb5f8f-rkz76:/$ which airflow
/usr/local/bin/airflow
airflow@airflow-scheduler-5469fb5f8f-rkz76:/$ cat $(!!)
cat $(which airflow)
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@jgogstad
jgogstad / gist:38f1e58f6c43f6cac0efd2ec96537cff
Last active April 3, 2020 08:12 — forked from VladUreche/gist:8396624
Scaladoc tutorial for docs.scala-lang.org, in a pitiful state

Scaladoc Developer Guide

Introduction

Scaladoc is the tool that enables developers to automatically generate documentation for their Scala (and Java) projects. It is Scala's equivalent of the widely-used Javadoc tool. This means that Javadoc (and even doxygen) users will be familiar with Scaladoc from day 1: for them, it is most beneficial to check out the Scaladoc/Javadoc comparison tables and if necessary, skim through this document to understand specific features.

The rest of this tutorial is aimed at developers new to Scaladoc and other similar tools. It assumes a basic understanding of the Scala language, which is necessary to follow the examples given throughout the tutorial. For the user perspective on the Scaladoc-generated documentation, such as finding a class, understanding the page layout, navigating through diagrams, please refer to the Scaladoc User Guide.

The tutorial will start by a short motivation and then will explain the main concept in Scaladoc: the doc comment.

Why document?

@jgogstad
jgogstad / disable-linters-sbt-tpolecat-intellij.md
Last active November 16, 2020 11:30
Disable unused scalac linters only in IntelliJ

sbt-tpolecat IntelliJ exemptions

This plugin lets you enforce strict linting rules and iterate quickly in IntelliJ at the same time.

Configure your build with sbt-tpolecat to prevent unused imports, unused parameters etc. to reach main. Adding the plugin below causes the following behavior:

  • All linters are enforced in sbt
  • The -Wunused:* flags are not enforced in IntelliJ
@jgogstad
jgogstad / jabba-jenv.md
Created November 11, 2021 08:00
JVM management on macOS: Jabba and jEnv
  • Jabba: Manage JVMs installations
  • jEnv: What JVM to use in shell/global/local directory.

jEnv supports automatically changing JVMs based on current working directory

Installation

brew install jabba
brew install jenv
@jgogstad
jgogstad / json_to_md.md
Created November 16, 2021 14:06
JSON to markdown

JSON → Markdown

brew install csvkit
jq -r '["pt", "c"], (.[] | [.pt, .c]) | @csv' <<< '[
 {
@jgogstad
jgogstad / pre-push
Last active August 29, 2022 11:18
Scala: Check formatting before push
# install natively compiled scalafmt, https://scalameta.org/scalafmt/
# .git/hooks/pre-push
scalafmt --check || (scalafmt && exit 1)