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
File file = /* 適当なFile(外部ストレージ上に保存している画像であること) */ | |
ContentResolver cr = context.getContentResolver(); | |
ContentValues cv = new ContentValues(); | |
cv.put(MediaStore.Images.Media.TITLE, file.getName()); | |
cv.put(MediaStore.Images.Media.DISPLAY_NAME, file.getName()); | |
cv.put(MediaStore.Images.Media.DATE_TAKEN, System.currentTimeMillis()); | |
cv.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); | |
cv.put(MediaStore.Images.Media.DATA, file.getAbsolutePath()); | |
Uri uri = cr.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, cv); |
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
Bitmap thumbnail = $.getCachedImage(thumbnailUrl.toString()); | |
$.id(R.id.image).image(url.toString(), false, false, 0, 0, thumbnail, 0); |
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
<?php | |
// set to Pico CMS root directory | |
require("lib/Pico.php"); | |
class Replacer extends Pico | |
{ | |
public function run(){ | |
$this->loadConfig(); | |
$files = $this->getFiles($this->getConfig("content_dir"), $this->getConfig("content_ext")); | |
foreach ($files as $file) { |
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
// note用 プロパティ表示ツール | |
// noteの編集画面において、文字数や段落数、マークダウン記法版文章を表示します。 | |
// ==ClosureCompiler== | |
// @output_file_name default.js | |
// @compilation_level ADVANCED_OPTIMIZATIONS | |
// ==/ClosureCompiler== | |
(function() { | |
let nb = (document.getElementById("note-body") || | |
document.querySelector("note-body div")); |
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
# 指定フォルダ配下のPowerPointファイルを一括してPDFに変換します。 | |
# PowerPoint自体を起動するので、動作に時間がかかります。 | |
# 動作中はPCを操作しないことを推奨します | |
# また、共有などのトラブルが発生した場合はダイアログが表示され、処理が中断されますので、「動作中は離席しないこと」を推奨します | |
# 参考:https://blogs.technet.microsoft.com/stanabe/2008/12/10/windows-powershell-powerpoint-xps-pdf/ | |
# 前準備 | |
$ppapp = new-object -com powerpoint.application | |
$ppapp.visible = [Microsoft.Office.Core.MsoTriState]::MsoTrue | |
$ppfiles = Get-ChildItem -Recurse *.pptx |
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カレンダーのスクリーンショットをとって紹介するとき、一部のイベントを伏せたいとかありませんか? | |
// そういうときのためのスクリプトです。Googleカレンダーの月ビューを表示中、開発者ツールを表示してコンソールに打ち込むコマンドです。 | |
// 下の/*隠したい予定のタイトルをここに入れる*/を隠したいイベントの名前に置き換えます。 | |
document.querySelectorAll("div[data-eventchip]").forEach((n) => {d = n.querySelector("div > span > span:last-child"); if(d.textContent == /*隠したい予定のタイトルをここに入れる*/) d.textContent = "予定あり"; }); |
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のコンソールで使うと良いです。 | |
s = """ | |
ここに変換したいテキストを入力 | |
""" | |
for n in s.split("\n"): | |
if n != "": | |
# ここに処理を入力 |
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
# あとで再利用可能な形にまとめるかも | |
# ex). 23:00→30分前を指定 22:30 | |
import re | |
import math | |
s = """ | |
ここに変換したい文章を入れる | |
""" | |
def timeshift(m): | |
t = int(m.group(1)) * 60 + int(m.group(2)) | |
t -= 0 # ここでタイムシフトしたい時間(分)を指定する |
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
// Zaimの日ごとの履歴一覧画面にチェックボックスを表示するBookmarklet | |
// 日ごとの履歴一覧を表示した状態で、ブックマークレットを実行してください。 | |
// 下記サイトでコンパイル可能です。 | |
// https://closure-compiler.appspot.com/ | |
// ==ClosureCompiler== | |
// @output_file_name default.js | |
// @compilation_level SIMPLE_OPTIMIZATIONS | |
// ==/ClosureCompiler== | |
javascript:(function(){ | |
let table = document.querySelector("#main .list"); |
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://to-do.office.com/today あたりで開発者モードを開きコンソールで実行する | |
var s = ""; | |
document.querySelectorAll(".taskItem-title").forEach((e) => { | |
s += e.textContent + "\n"; | |
}); | |
prompt("CopyThis", s); |