Skip to content

Instantly share code, notes, and snippets.

View ecoopnet's full-sized avatar

M.Inomata ecoopnet

View GitHub Profile
/**
* Google ドキュメントのフォームから投稿があったら確認メールを自動返信する(日本語版)
* English version will be available later.
*
* @author Masunaga Ray ( http://www.msng.info/ )
* @instruction http://www.msng.info/archives/2012/04/google-docs-auto-reply.php
*/
function sendConfirmation() {
try {
var ss = SpreadsheetApp.getActiveSpreadsheet();
@ecoopnet
ecoopnet / logarithms-value-interpolation.swift
Last active May 1, 2017 11:09
interval秒の間、時間をかけてfrom から toに移動するサンプル。①0から遷移 ②0に遷移 ③それ以外の遷移で遷移パターンを変えています。
//: Playground - noun: a place where people can play
import Foundation
///
class ValueCalculator{
let INCREASE_ZERO_INTERVAL:TimeInterval = 12.0
let DECREASE_ZERO_INTERVAL:TimeInterval = 13.0
let DEFAULT_INTERVAL:TimeInterval = 3.0
let interval:TimeInterval
@ecoopnet
ecoopnet / generate-drawables-from-xxhdpi.sh
Last active May 16, 2017 13:08
Android の drawable-xxhdpi から drawable-hdpi, drawable-xhdpiに自動で画像作成します。
#!/bin/sh
# Android の drawable-xxhdpi から drawable-hdpi, drawable-xhdpiに自動で画像作成するスクリプトです。
# Android プロジェクト直下で動きます。
# app/src/main/res/drawable-xxhdpi フォルダを検索し、 drawable-xhdpi, drawable-hdpi に変換します。
# また、このスクリプトを動作させるにはImageMagickが必要です。
(
resDir=app/src/main/res
@ecoopnet
ecoopnet / mpeg2gif
Last active December 23, 2021 10:02
#!/bin/sh
# Convert mp4 video to animation GIF.
# Requirement: ffmpeg
if [ -z "$1" ]; then
(
echo "Usage: $(basename $0) video-file.mp4 [extra-options]
Convert mp4 video to animation GIF.
i.e: if ~/Downloads/video-file.mp4 was passed, ~/Downloads/video-file.gif was generated.
@ecoopnet
ecoopnet / GeneratorSequence.py
Last active September 7, 2018 09:45
Deep Learning Tools (mainly for keras)
from keras.utils import Sequence
import threading
class GeneratorSequence(Sequence):
'''
Convert generator to keras.utils.Sequence
Usage:
length = 100000 # ,length of dataset. If generator is countable, it can be `length = len(generator)`.
train_generator = train_dataset.generate( ... ) # create uncountable generator.
validate_generator = validate_dataset.generate( ... ) # create uncountable generator.
import Foundation
extension CGPoint {
// CGPoint -> Point<Double> に変換
func toPoint() -> Point<Double> {
return Point<Double>(x: Double(x), y: Double(y))
}
}
extension CGSize {
@ecoopnet
ecoopnet / MaBeeeSDK_code.podspec
Last active March 1, 2023 10:33
MaBeeeSDK_code
# https://gist.githubusercontent.com/syiss0257/ed30778981b134838063a10986baf61b/raw/066923c899e74b1d34bd4634d2de10ab69e35f49/MaBeeeSDK_code.podspec
Pod::Spec.new do |s|
s.name = 'MaBeeeSDK_code'
s.version = '0.1.0'
s.summary = 'MaBeee SDK_code for iOS.'
s.description = 'MaBeee SDK for iOS from code.'
s.homepage = 'https://guildworks.jp/'
s.license = {
:type => 'Copyright',
:text => 'Copyright GuildWorks.'
@ecoopnet
ecoopnet / Kotlin graphics util
Created July 30, 2020 11:55
Android Kotlin Graphics Utility.
// python numpy の処理をRectに適用できても面白いかも。
// TODO:
// fun RectF().toInt(): Rect
// fun Rect().toFloat(): RectF
// fun Rect.scaleCenter(scaleX: Float, scaleY: Float): RectF
// fun Rect.scaleCenter(scaleXY: Float): RectF
/// Scale X and Y separately.
fun Rect.scale(scaleX: Float, scaleY): RectF
# Remove audio from video.
# Input: from.mov
# Output: to.mov
ffmpeg -i from.mov -c copy -an to.mov
@ecoopnet
ecoopnet / fetch_urls.sh
Last active April 4, 2024 02:34
指定したURLから再帰的にURLを取ってくるスクリプト
#!/bin/bash
# Usage: fetch_urls.sh "URL"
# Example: fetch_urls.sh "https://example.com/" | tee urls.txt
# https://example.com/ に再帰的にアクセスして、 urls.txt にURL一覧を書き出す
# Requirements: wget perl
# wget が入ってない場合、 brew install wget などでインストールして下さい。
_url="$1"
(
wget -nd -nH --spider --recursive --level=inf --no-verbose --execute robots=off "$_url" 2>&1