Skip to content

Instantly share code, notes, and snippets.

View mumoshu's full-sized avatar
🏠
Working from home

Yusuke Kuoka mumoshu

🏠
Working from home
View GitHub Profile
@mumoshu
mumoshu / prow.md
Last active July 2, 2019 04:46
helmfile + flagger + istio + chatops demo

Generate a random password for verifying HTTP requests from GitHub to your WebHook endpoint:

openssl rand -hex 20 > /path/to/hook_secret

Decide the GitHub repository named for the demo:

ORG=mumoshu # Replace with your org name!
$ goweight ./
5.7 MB github.com/aws/aws-sdk-go/service/s3
3.8 MB net/http
3.3 MB runtime
1.9 MB golang.org/x/net/http2
1.8 MB github.com/golang/protobuf/proto
1.8 MB net
1.8 MB crypto/tls
1.7 MB google.golang.org/api/storage/v1
1.5 MB github.com/aws/aws-sdk-go/aws/endpoints
@mumoshu
mumoshu / build.sbt
Created January 10, 2012 02:52
DES encryption in Scala
name := "DES encryption in Scala"
version := "1.0"
scalaVersion := "2.9.1"
libraryDependencies += "commons-codec" % "commons-codec" % "1.6"
@mumoshu
mumoshu / read-a-file-using-stream.scala
Created December 9, 2011 00:58
Read a file using Stream (Scala)
import java.io.File
import java.io.FileInputStream
case class Chunk(length: Int, bytes: Array[Byte])
def fileContentStream(fileIn: FileInputStream): Stream[Chunk] = {
val bytes = Array.fill[Byte](1024)(0)
val length = fileIn.read(bytes)
Chunk(length, bytes) #:: fileContentStream(fileIn)
}
@mumoshu
mumoshu / eks
Last active February 1, 2019 06:12
ek
#!/usr/bin/env variant
mixins:
cluster: &cluster
type: object
properties:
vpc-private-subnets:
type: array
vpc-public-subnets:
type: array

Rationale

I'm doing GitOps(https://www.weave.works/blog/gitops-operations-by-pull-request). Personally I've been using brigade and atlantis for their respective sweet-spots.

However, all the existing solutions had required me to maintain machines to host them. Something that works in long term without my hand is always appreciated.

What

I'd like it a lot if Codefresh added "Slack" or more generically "Webhook" as pipeline triggers.

try:
tf.nn.seq2seq = tf.contrib.legacy_seq2seq
tf.nn.rnn_cell = tf.contrib.rnn
tf.nn.rnn_cell.GRUCell = tf.contrib.rnn.GRUCell
tf.nn.rnn = tf.contrib.rnn.static_rnn
# https://github.com/tensorflow/tensorflow/issues/7032
tf.sub = tf.subtract
# https://stackoverflow.com/questions/47296969/valueerror-variable-rnn-basic-rnn-cell-kernel-already-exists-disallowed-did-y
tf.reset_default_graph()
print("TensorFlow's version : 1.0 (or more)")
@mumoshu
mumoshu / main.go
Created September 9, 2018 03:58
httpserver in go for demo purpose
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}
@mumoshu
mumoshu / example.scala
Created June 19, 2011 08:45
Scala 2.9.0.1で限定継続を利用した自作非同期HTTPの超簡単なサンプル
import actors.Actor
import io.Source
import java.lang.StringBuilder
import scala.util.continuations.{reset, shift}
import scala.actors.Actor.{loop, react}
/**
* {@link Request}を実行し、{@link Response}を返すtrait
*/
trait Http {
(function($) {
/**
* アプリケーション全体で共有するデータを保持したり、変更を通知する
*/
function Registry() {
}
Registry.prototype.put = function(key, value) {
this[key] = value;