Skip to content

Instantly share code, notes, and snippets.

@takezoe
takezoe / jupyter_on_docker.md
Last active April 29, 2023 05:50
Run JupyterLab on Docker
View jupyter_on_docker.md

Run JupyterLab on docker

https://hub.docker.com/r/jupyter/scipy-notebook/

$ docker pull jupyter/scipy-notebook

$ docker run -v `pwd`:/home/jovyan/work -p 10000:8888 --name jupyter jupyter/scipy-notebook
...
 To access the server, open this file in a browser:
@takezoe
takezoe / vscode_metals.md
Last active March 12, 2022 00:35
Keyboard shortcuts in VSCode + Metals
View vscode_metals.md

VS Code shortcut in VSCode + Metals

Shorcut Description
CTRL + SPACE Code Completion
COMMAND + P Find File
COMMAND + SHIFT + P Command Pallete
COMMAND + T Find Symbol in Workspace
SHIFT + COMMAND + O Find Symbol in Editor
F12 Go to Definition
@takezoe
takezoe / trino_test.rb
Created May 7, 2021 16:38
Test program for trino-client-ruby using tiny-presto which is library to launch Trino/Presto using docker
View trino_test.rb
require 'trino-client'
require 'tiny-presto'
client = Trino::Client.new(server: 'localhost:8080', catalog: 'memory', user: 'test-user', schema: 'default')
cluster = TinyPresto::Cluster.new('trinodb/trino', '355')
container = cluster.run
loop do
begin
# Make sure to all workers are available.
client.run('show schemas')
@takezoe
takezoe / build.yml
Last active January 23, 2021 16:16
GitHub Actions configuration for GitBucket plugins
View build.yml
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 11]
View test.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View CyclicDependency.scala
trait CyclicA {
val b = bind[CyclicB]
}
trait CyclicB {
val a = bind[CyclicA]
}
val d = Design.newDesign
d.build[CyclicA] { a =>
View Hello_PredictionIO.md

Hello Apache PredictionIO!

Start event server:

$ pio eventserver &
View scalatra-remove-joda.diff
diff --git a/swagger/src/main/scala/org/scalatra/swagger/Swagger.scala b/swagger/src/main/scala/org/scalatra/swagger/Swagger.scala
index 97e00e46..f5525ca2 100644
--- a/swagger/src/main/scala/org/scalatra/swagger/Swagger.scala
+++ b/swagger/src/main/scala/org/scalatra/swagger/Swagger.scala
@@ -45,16 +45,6 @@ trait SwaggerEngine[T <: SwaggerApi[_]] {
object Swagger {
- val excludes: Set[java.lang.reflect.Type] = Set(
- classOf[java.util.TimeZone],
View sparksql-nested-json.md

Test data:

{"maker":"Apple", "products":[{"name": "iPhobe", "price": 100000}, {"name": "iPad", "price": 120000}]}
{"maker":"ASUS", "products":[{"name": "Zenfone", "price": 20000}]}

DataFrame:

scala> val df = ds.select(ds("maker"),explode(ds("products")).as("p"))
scala&gt; df.select("maker", "p.name", "p.price").show
@takezoe
takezoe / get-authors.sh
Created September 21, 2018 02:34
Get authors since the specified tag from git log
View get-authors.sh
git log v0.12.1... | grep Author | sed -e "s/^Author: //g" | sed -e "s/ <.*>//g" | sort | uniq