Skip to content

Instantly share code, notes, and snippets.

View motokiee's full-sized avatar
🎯
Focusing

motokiee motokiee

🎯
Focusing
  • Mercari, Inc.
  • Tokyo
  • 20:34 (UTC +09:00)
  • X @motokiee
View GitHub Profile
@motokiee
motokiee / itc_status_slack_notification.gs
Last active November 13, 2023 04:23
Post iTunes Connect Status to Slack with Gmail using Google Apps Script
var mailAddress = "YOUR_EMAIL_ADDRSS";
var slackToken = "SLACK_TOKEN";
var searchMailQuery = 'SEARCH_QUERY'; // example: '[from:no_reply@email.apple.com YOUR_APP_NAME]';
var slackChannelId = "SLACK_CHANNEL_ID";
function getAttachment(message) {
var subject = message.getSubject();
var body = message.getPlainBody();
@motokiee
motokiee / lgtm_iosdc2017.svg
Last active September 17, 2017 04:39
lgtm_iosdc2017
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
def soft_max(a):
c = np.max(a)
exp_a = np.exp(a-c)
sum_exp_a = np.sum(exp_a)
y = exp_a / sum_exp_a
return y
struct Extension<Base> {
let base: Base
init (_ base: Base) {
self.base = base
}
}
protocol ExtensionCompatible {
associatedtype Compatible
static var ex: Extension<Compatible>.Type { get }
@motokiee
motokiee / CodePiece.go
Created May 25, 2016 13:07
パッケージ変数をいまいち理解してないので明日調べよう #CodePiece
var someString string // 初期値が必要ないときによく使う
var someString2 = "test" // パッケージ変数の宣言に使う
someString3 := "test" // 一番よく目にするやつ
@motokiee
motokiee / CodePiece.go
Created May 24, 2016 00:34
型アサーションは(T, bool)を返すと #CodePiece
func (c *client) read() {
for {
var msg *message
if err := c.socket.ReadJSON(&msg); err == nil {
msg.When = time.Now()
msg.Name = c.userData["name"].(string)
if avatarURL, ok := c.userData["avatar_url"]; ok {
msg.AvatarURL = avatarURL.(string)
}
c.room.forward <- msg
@motokiee
motokiee / CodePiece.go
Created May 24, 2016 00:28
goの勉強 #CodePiece
package main
import "time"
type message struct {
Name string
Message string
When time.Time //メッセージ送信時刻
AvatarURL string
}
@motokiee
motokiee / CodePiece.swift
Created March 16, 2016 00:42
なるほどSwift3以降もタプル自体は比較できないのか。あくまでもタプルの要素の比較なんだな。 #CodePiece
/* Swift version 3.0-dev (LLVM b361b0fc05, Clang 11493b0f62, Swift 24a0c3de75)
Target: x86_64-unknown-linux-gnu */
let numbers1 = (1,1,1,1,1)
let numbers2 = (2,2,2,2,2)
let tuple1 = (numbers1, numbers2)
let tuple2 = (numbers1, numbers2)
print("bool: \(tuple1 == tuple2)") // error
let tuple3 = ((),())
@motokiee
motokiee / CodePiece.m
Created March 1, 2016 05:00
Objective-Cでこんなメソッドを作って、Swiftから呼び出してみたけど空文字でクラッシュしなかった。_StringCoreの_ownerがnilだとこうなるっぽい...? #CodePiece
- (nonnull NSString*)hey {
return nil;
}
@motokiee
motokiee / CodePiece.go
Created January 27, 2016 16:44
ちょっとgolangいじったし寝る #CodePiece
package main
import "fmt"
type Person struct {
*Programmer
name string
age int
}