Skip to content

Instantly share code, notes, and snippets.

View dongjinahn's full-sized avatar
💭
⛄️

Dong-jin Ahn dongjinahn

💭
⛄️
View GitHub Profile
(function() {
'use strict';
console.log('Working?');
})();
<template>
  <div>
    <h1 v-if="a === 'some_string'">Hello, World!</h1>
  </div>
</template>
<script>
export default {
  data() {
    return {
state: {
user: {
id: null,
email: null,
},
}
val m = Map(
"name" -> "john doe",
"age" -> 18,
"hasChild" -> true,
"childs" -> List("a", "b", "c")
)
import net.liftweb.json.JsonAST._
import net.liftweb.json.JsonDSL._
import net.liftweb.json.Printer._
val m2: Map[String, JValue] = Map(
"name" -> "john doe",
"age" -> 18,
"hasChild" -> true,
"childs" -> List("a", "b", "c")
)
val json = JObject(m2.toList.map(x => JField(x._1, x._2)))
// Compact
compact(render(json))
// Pretty
pretty(render(json))
@dongjinahn
dongjinahn / 1.js
Created February 14, 2018 08:11
Test
console.log(1);
@dongjinahn
dongjinahn / 1.scala
Last active February 14, 2018 08:21
df to map spark scala
ageGroup.collect.map(_.toSeq.toList)
res55: Array[List[Any]] = Array(List(31, 4), List(65, 10), List(53, 7), List(34, 6), List(28, 9), List(27, 7), List(26, 2), List(44, 16), List(47, 5), List(52, 3), List(40, 9), List(57, 11), List(54, 14), List(48, 13), List(64, 8), List(41, 15), List(43, 13), List(37, 13), List(61, 6), List(35, 5), List(55, 16), List(59, 9), List(39, 11), List(23, 1), List(49, 14), List(51, 8), List(63, 10), List(50, 4), List(45, 12), List(38, 7), List(25, 10), List(24, 5), List(62, 6), List(29, 11), List(32, 10), List(60, 11), List(56, 13), List(58, 5), List(33, 6), List(68, 5), List(42, 19), List(30, 4), List(66, 6), List(67, 8), List(46, 14), List(36, 14))