Skip to content

Instantly share code, notes, and snippets.

@S-YOU
S-YOU / checka-firestore.rules
Created February 6, 2019 11:06 — forked from mogaming217/checka-firestore.rules
何かおかしそうなところがあれば教えてください。
service cloud.firestore {
match /databases/{database}/documents {
match /groups/{groupID} {
allow get, update: if isAuthenticated() && isUserBelongingToThisGroup(groupID, request.auth.uid);
match /users/{userID} {
allow read: if isAuthenticated() && isUserBelongingToThisGroup(groupID, request.auth.uid);
}
match /boards/{boardID} {
@S-YOU
S-YOU / 1.js
Created February 1, 2019 16:00 — forked from getify/1.js
creating hard-bound methods on classes
class Foo {
constructor(x) { this.foo = x; }
hello() { console.log(this.foo); }
}
class Bar extends Foo {
constructor(x) { super(x); this.bar = x * 100; }
world() { console.log(this.bar); }
}
func merge_sort(l []int) []int {
if len(l) < 2 {
return l
}
mid := len(l) / 2
a := merge_sort(l[:mid])
b := merge_sort(l[mid:])
return merge(a, b)
}
@S-YOU
S-YOU / brew-list.sh
Created December 28, 2018 09:11 — forked from eguven/brew-list.sh
list homebrew installed packages and their size
for pkg in `brew list -f1 | egrep -v '\.|\.\.'`
do echo $pkg `brew info $pkg | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/\1/'`
done
@S-YOU
S-YOU / poc.rb
Created December 10, 2018 13:39 — forked from zelivans/poc.rb
CVE-2018-1002105 exploit
#!/usr/bin/env ruby
require 'socket'
require 'openssl'
require 'json'
host = 'kubernetes'
metrics = '/apis/metrics.k8s.io/v1beta1'
sock = TCPSocket.new host, 443
core@ip-10-128-3-24 ~ $ etcdctl watch /deis --recursive --forever | awk '{now=strftime("%F %T%z\t");sub(/^/, now);print}'
2015-07-24 16:37:28+0000 8888
2015-07-24 16:37:28+0000 10.128.3.140:60974
2015-07-24 16:37:28+0000 10.128.1.32
2015-07-24 16:37:28+0000 10.128.1.31
2015-07-24 16:37:28+0000 10.128.3.140:59072
2015-07-24 16:37:28+0000 5432
2015-07-24 16:37:29+0000 10.128.1.31
2015-07-24 16:37:29+0000 8888
2015-07-24 16:37:29+0000 10.128.3.24:63735
@S-YOU
S-YOU / main.go
Created November 25, 2018 02:01 — forked from sbuss/main.go
Stackdriver logging with request grouping for App Engine Go 1.11
// Sample logging-quickstart writes a log entry to Stackdriver Logging.
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"

slidenumbers: true

SwiftのGenericsとProtocolの実装

omochimetaru

言語処理系勉強会 Vol.1


@S-YOU
S-YOU / detect_marker.py
Created November 3, 2018 04:31 — forked from ksasao/detect_marker.py
ZOZOSUITのマーカーのIDを読み取るコードです。公開されている画像を元に独自に解析しているので、公式ではこのように処理しているかどうかは不明です。仕様等については https://twitter.com/ksasao/status/990779583682170881 のスレッドも参照してください。全身を読み取るコード https://twitter.com/ksasao/status/989842844243279872 ライセンスは Apache License 2.0 です。
import numpy as np
import random
import math
import cv2
from PIL import Image
import sys
def detect_markers(im):
markers = []
# 輪郭線抽出のための二値化
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.