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
#!/usr/bin/env python3 | |
import json | |
# metaのアカウントセンターからダウンロードしたinstagramのjsonデータが変な形式なので、読める形に変換して書き出す。 | |
# (なぜか非 ascii 文字列が \uxxx がバイトコードになってて普通には読めない…) | |
# 元jsonファイル | |
json_file = "~/Downloads/posts_1.json" | |
out_file = json_file + ".out.json" |
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
// 任意のコレクション型に文字列を返す dump メソッドを追加する。 | |
private fun Any.dump(): String { | |
if (this is Map<*, *>) { | |
return dump() | |
} | |
if (this is List<*>) { | |
return dump() | |
} |
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 | |
# 導入: | |
# 1. download-arxiv-pdfs.sh (このファイル)をダウンロードする | |
# 2. chmod +x download-arxiv-pdfs.sh | |
# 使い方: | |
# ./download-arxiv-pdfs.sh 2022-02-18-recent.txt # 勉強会用の recent.txt または hype.txtを指定 | |
top10txtfile="$1" | |
if [ '!' -s "$top10txtfile" -o $(basename "$top10txtfile" | sed -e 's/^[^\.]*\.//') != txt ]; then | |
echo "arxiv sanity の top hype か top recent のまとめtxtファイルを指定して下さい。" >&2 |
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 | |
# DB名や接続情報を元に、table名、カラム名の一覧CSVを生成する | |
# 例: mysql_dump_scheme.sh mydatabase > out.csv | |
# 例: mysql_dump_scheme.sh -u myuser -p 'xxx' mydatabase > out2.csv | |
dbname="$1" | |
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
// ==UserScript== | |
// @name MoneyForwardユーティリティ | |
// @namespace Violentmonkey Scripts | |
// @match https://moneyforward.com/* | |
// @grant none | |
// @version 1.0 | |
// @author ecoopnet | |
// @description 2020/9/11 11:21:36 | |
// ==/UserScript== | |
$(function(){ |
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 |
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
// 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
# 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
import Foundation | |
extension CGPoint { | |
// CGPoint -> Point<Double> に変換 | |
func toPoint() -> Point<Double> { | |
return Point<Double>(x: Double(x), y: Double(y)) | |
} | |
} | |
extension CGSize { |
NewerOlder