Skip to content

Instantly share code, notes, and snippets.

View YuheiNakasaka's full-sized avatar
💭
😇

razokulover YuheiNakasaka

💭
😇
View GitHub Profile
flowchart LR;
  subgraph Domain
    subgraph "Entiry(freezed)"
    end
    subgraph Provider1
      subgraph Service
      end
      subgraph Repository
 end
@YuheiNakasaka
YuheiNakasaka / flutter_clean.py
Created June 1, 2021 04:46
This script cleans flutter projects by deleting caches and build outputs.
import os
import subprocess
import sys
# This script cleans flutter projects by deleting caches and build outputs.
# Example:
# $ python flutter_clean.py /Users/razokulover/src/github.com/YuheiNakasaka
def rm_ios_files(abs_path):
@YuheiNakasaka
YuheiNakasaka / spectrogram.rb
Created January 13, 2020 11:11
適当な音声ファイルをffmpegでwavにしてsoxでspectrogramを作るやつ
start = 0
sec = 2
if ARGV.length == 3
file = ARGV[0]
start = ARGV[1]
sec = ARGV[2]
else
file = ARGV[0]
end
@YuheiNakasaka
YuheiNakasaka / spectgram.rb
Last active March 19, 2019 10:25
サンプルボイスとかのmp3 urlから声紋画像を得る
# Usage:
# ruby spectrogram.rb <FILE URL>
# Example:
# ruby spectrogram.rb http://www.imenterprise.jp/voice/voice/v86.mp3
unless ARGV[0].nil?
filename = File.basename(ARGV[0]).sub(/\..*/, '')
start = ARGV[1] || 0
duration = ARGV[2] || 1.5
system("wget #{ARGV[0]} -O #{filename}.mp3")
system("ffmpeg -y -i #{filename}.mp3 -vn -ac 2 -ar 44100 -acodec pcm_s16le -f wav #{filename}.wav")
@YuheiNakasaka
YuheiNakasaka / policy.xml
Created October 17, 2018 05:27
policy.xml of ImageMagick in AWS Lambda
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policymap [
<!ELEMENT policymap (policy)+>
<!ELEMENT policy (#PCDATA)>
<!ATTLIST policy domain (delegate|coder|filter|path|resource) #IMPLIED>
<!ATTLIST policy name CDATA #IMPLIED>
<!ATTLIST policy rights CDATA #IMPLIED>
<!ATTLIST policy pattern CDATA #IMPLIED>
<!ATTLIST policy value CDATA #IMPLIED>
]>
@YuheiNakasaka
YuheiNakasaka / iraq_nippo.rb
Created April 17, 2018 02:33
イラク日報のpdfを全部ダウンロードするrubyスクリプト
require "nokogiri"
require "open-uri"
require 'fileutils'
# create directory to download pdfs
download_dir = "/home/hoge/iraq-nippo-list"
if !File.exists?(download_dir)
FileUtils::mkdir_p(download_dir)
end
@YuheiNakasaka
YuheiNakasaka / channel_lock_sample.go
Created March 11, 2018 09:36
Goのchannelを使って処理のブロックを実装する
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("Start")
queue := make(chan int, 3)
@YuheiNakasaka
YuheiNakasaka / tekitoru_flow.js
Created February 18, 2018 11:24
適当にflowの練習
/* @flow */
function p(w: string) {
return new Promise(resolve => {
setTimeout(() => {
resolve(w);
}, 100);
});
}
@YuheiNakasaka
YuheiNakasaka / companies.md
Last active January 22, 2018 05:16 — forked from okohs/whitelist.md
20180122_定時前に帰宅できた企業

書き方

該当する各社の対応欄に企業名を書いてください。備考があれば適宜カッコ書きしてください。

出勤していない(終日在宅勤務含む)

早めに退勤できた

  • 株式会社アイスタイル
  • 株式会社GIFMAGAZINE