Skip to content

Instantly share code, notes, and snippets.

View dulltz's full-sized avatar
๐Ÿ 
Working from home

Takahiro Tsuruda dulltz

๐Ÿ 
Working from home
  • Tokyo
  • 10:21 (UTC +09:00)
  • X @dulltz
View GitHub Profile
@dulltz
dulltz / syoboi.rb
Created July 3, 2013 07:21
ใ—ใ‚‡ใผใ„ใ‚ซใƒฌใƒณใƒ€ใƒผใ‹ใ‚‰ใ‚นใ‚ฟใƒƒใƒ•ใจใ‚ญใƒฃใ‚นใƒˆใ‚’ใƒ‘ใƒผใ‚นใ—ใฆไฟๅญ˜ใ™ใ‚‹
# coding: utf-8
require 'nokogiri'
require 'open-uri'
module My
class SyoboiParser
attr_accessor :anime_number
def initialize(anime_number)
@anime_number = anime_number
end
@dulltz
dulltz / gist:5916076
Created July 3, 2013 07:24
ใ‚นใ‚ณใ‚ขใ‚’่จˆ็ฎ—ใ—ใŸ็ตๆžœ
-------------Group 0-----------------------
ใ‚ฝใƒ‹ใƒƒใ‚ฏ๏ผธ
ๆˆๆตใฎไธ–็•Œ
ใƒ€ใƒผใ‚ฏใƒปใ‚จใƒณใ‚ธใ‚งใƒซII
*ใ‚ขใƒณใƒ†ใƒŠ๏ผš็•ช็ต„่กจใ‚’ใ‚ญใƒผใƒฏใƒผใƒ‰ๆคœ็ดข*
ใ‚ชใƒผใƒซใ‚นใ‚ฟใƒผๆ„Ÿ่ฌ็ฅญ
้–ขๅฃใ•ใ‚“II
ใ‚ซใ‚นใƒŸใƒณ(3)
ๆ™‚็ฉบๅ†’้™บ่จ˜ใ‚ผใƒณใƒˆใƒชใƒƒใ‚ฏใ‚น
FIRESTORM
@dulltz
dulltz / gist:5931406
Last active December 19, 2015 09:09
2013ๆ˜ฅC ็Ÿฅ่ญ˜ใƒป่‡ช็„ถ่จ€่ชžๅ‡ฆ็†ใฎ่ชฒ้กŒ(1)
mecab -F "%f[6] %f[0]\n" sen179k.txt | LC_ALL=C sort | uniq -c | LC_ALL=C sort -nr | grep -v "EOS" | sed 15q > result1-1.txt
mecab -F "%f[6] %f[0]\n" neko.txt | grep "ๅ่ฉž" | LC_ALL=C sort | uniq -c | LC_ALL=C sort -nr | grep -v "EOS" | sed 15q > result1-2.txt
wget http://www.mast.tsukuba.ac.jp/outline/index.html
mecab -F "%f[6] %f[0]\n" index.html | egrep " ๅ‹•่ฉž|ๅ่ฉž" | LC_ALL=C sort | uniq -c | grep -v "EOS" > result1-3.txt
@dulltz
dulltz / booru_clawler.rb
Last active August 29, 2015 14:22
booru clawler
require 'faraday'
require 'json'
require 'open-uri'
require 'fileutils'
def get_posts tags=['genga','yoh_yoshinari'], site_url='http://sakuga.yshi.org', mode=:normal
conn = Faraday::Connection.new(url: site_url) do |builder|
builder.use Faraday::Request::UrlEncoded
builder.use Faraday::Response::Logger
builder.use Faraday::Adapter::NetHttp
#!/usr/bin/env ruby
require 'open-uri'
base_urls = %w(http://mgkkk.cocolog-nifty.com/blog/files/
http://mgkkk.la.coocan.jp/podcast/
)
start_i = ARGV[0].nil? ? 0 : ARGV[0].to_i
end_i = ARGV[1].nil? ? 211 : ARGV[1].to_i
base_i=0
@dulltz
dulltz / 1-1.rb
Created January 20, 2016 13:12
ไธ–็•Œใงๆˆฆใ†ใƒ—ใƒญใ‚ฐใƒฉใƒŸใƒณใ‚ฐๅŠ›ใ‚’้›ใˆใ‚‹150ๅ• ใฎ่งฃ็ญ”
# encoding: utf-8
counter = Hash.new(0)
$stdin.read.split("").each do |w|
counter[w] += 1
end
if counter.values.max <= 1
puts "No duplication"
elsif
puts "duplication"
@dulltz
dulltz / gist:79606e5d38ffb7644072d2224e2e0fa2
Last active September 7, 2017 01:15
ใƒชใƒผใƒ€ใƒ–ใƒซใ‚ณใƒผใƒ‰4็ซ 

ใพใจใ‚

  • ใ‚ณใƒผใƒ‰ใฎใ‚ทใƒซใ‚จใƒƒใƒˆใ‚’ๆ•ดใˆใ‚ˆใ†
  • ใƒกใ‚ฝใƒƒใƒ‰ๅ†…ใฎๅ‡ฆ็†ใ‚’ๅˆ†้กžใ—ใฆใพใจใ‚ใ‚ˆใ†
  • ๆ•ดๅˆ—ใงใใ‚‹ใ‚ˆใ†ใซๅ…ฑ้€šๅ‡ฆ็†ใ‚’ๆŠœใๅ‡บใใ†

ใชใœ็พŽใ—ใ•ใŒๅคงๅˆ‡ใ‹

ใƒ‘ใƒƒใƒˆ่ฆ‹ใงใ‚ใ‹ใ‚‹ใ‹ใ‚‰

kind: Node
name: my-node
spec:
interfaces:
- my-net
volumes:
- name: ubuntu
source: https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
recreatePolicy: IfNotPresent
- name: seed
package main
import (
"fmt"
"golang.org/x/tour/tree"
)
// Walk walks the tree t sending all values
// from the tree to the channel ch.
@dulltz
dulltz / main.go
Created September 14, 2018 02:33
Create RBAC
package main
import (
"flag"
"fmt"
"path/filepath"
"k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"