This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension CGPoint { | |
// CGPoint -> Point<Double> に変換 | |
func toPoint() -> Point<Double> { | |
return Point<Double>(x: Double(x), y: Double(y)) | |
} | |
} | |
extension CGSize { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove audio from video. | |
# Input: from.mov | |
# Output: to.mov | |
ffmpeg -i from.mov -c copy -an to.mov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
OlderNewer