Skip to content

Instantly share code, notes, and snippets.

@takezoe
takezoe / get-authors.sh
Created September 21, 2018 02:34
Get authors since the specified tag from git log
git log v0.12.1... | grep Author | sed -e "s/^Author: //g" | sed -e "s/ <.*>//g" | sort | uniq
@takezoe
takezoe / gitbucket-pod.yaml
Last active September 11, 2018 13:53
Run GitBucket + PostgreSQL on Kubernetes
apiVersion: v1
kind: Pod
metadata:
name: gitbucket
labels:
app: gitbucket
spec:
containers:
- name: postgresql
image: postgres:9.5-alpine
@takezoe
takezoe / relative_time_range.md
Last active August 14, 2018 13:53
Relative time range expression supported in JTimeWindow
Duration Definition start end (exclusive)
0h this hour 2016-06-26 01:00:00-0700 2016-06-26 02:00:00-0700
0d today 2016-06-26 00:00:00-0700 2016-06-27 00:00:00-0700
0M this month 2016-06-01 00:00:00-0700 2016-07-01 00:00:00-0700
-1h last hour 2016-06-26 00:00:00-0700 2016-06-26 01:00:00-0700
-1h/now last hour to now 2016-06-26 00:00:00-0700 2016-06-26 01:23:45-0700
-60m/2017-01-23 01:23:45 last 60 minutes to now 2017-01-23 00:23:00-0700 2017-01-23 01:23:45-0700
-1d last day 2016-06-25 00:00:00-0700 2016-06-26 00:00:00-0700
-7d last 7 days
@takezoe
takezoe / init.el
Last active September 5, 2018 04:53
My simplest Emacs configuration
(menu-bar-mode -1)
(global-hl-line-mode 1)
(setq hl-line-face 'underline)
(setq mode-require-final-newline nil)
(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)
(show-paren-mode t)
(global-linum-mode t)
(setq linum-format "%d ")
@takezoe
takezoe / github_issues.ipynb
Last active May 4, 2018 00:52
scikit-learnでGitHubのイシューのラベル判定をやってみた
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package com.github.takezoe.gitmesh.repository
import java.io.File
import org.apache.commons.io.FileUtils
import org.eclipse.jgit.api.Git
object GitSyncTest extends App {
val repo1 = new File("/tmp/repo1")
@takezoe
takezoe / 1.scala
Last active March 27, 2018 02:47
PredictionIO and Zeppelin
%dep
z.load("org.apache.predictionio:apache-predictionio-core_2.11:0.12.1")
z.load("org.apache.predictionio:apache-predictionio-data_2.11:0.12.1")
z.load("org.apache.predictionio:apache-predictionio-data-jdbc_2.11:0.12.1")
z.load("org.postgresql:postgresql:42.1.4")
z.load("org.clapper:grizzled-slf4j_2.11:1.3.2")
z.load("com.github.nscala-time:nscala-time_2.11:2.18.0")
z.load("org.json4s:json4s-native_2.11:3.2.11")
@takezoe
takezoe / default.css
Created February 24, 2018 02:59
Default theme of FreeStyle Wiki
body {
background-color: #FFFFFF;
color : #000000;
}
div.adminmenu {
text-align : right;
padding-bottom : 5px;
margin-bottom : 5px;
border-bottom : #000088 1px dotted;
@takezoe
takezoe / c3linechart.html
Last active February 5, 2018 18:39
Chart Example by C3 and Chart.js
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<body>
<div style="width:600px;text-align:center;color:gray;">
Number of messages (last 1 hour)
</div>
<div id="stage" style="width:600px;height:150px;"></div>
</body>
<script>
Plotly.plot( 'stage', [
{
import Data.Vect
myReverse : Vect n elem -> Vect n elem
myReverse [] = []
-- myReverse {n = S k} (x :: xs)
-- = let result = myReverse xs ++ [x] in
-- rewrite plusCommutative 1 k in result
myReverse (x :: xs) = reverseProof x xs (myReverse xs ++ [x])
where
reverseProof : (x : elem) -> (xs : Vect len elem) -> Vect (len + 1) elem -> Vect (S len) elem