View AssetInstaller.java
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
/** | |
* http://outcesticide.hatenablog.com/entries/2012/12/12 | |
* の記事を参考にしています。 | |
*/ | |
import java.io.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; |
View wallpaper.py
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
# -*- coding: utf-8 -*- | |
from PIL import Image | |
from PIL import ImageDraw | |
import colorsys | |
import sys | |
### http://code.activestate.com/recipes/266466-html-colors-tofrom-rgb-tuples/history/2/ | |
def RGBToHTMLColor(rgb_tuple): | |
""" convert an (R, G, B) tuple to #RRGGBB """ | |
hexcolor = '#%02x%02x%02x' % rgb_tuple |
View NextMottoMotto
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 | |
/* | |
* NextMottoMotto | |
* Author:高見知英( http://onpu-tamago.net/ ) | |
* 次のもっともっと交流ステーションの日付を取得するスニペット | |
*/ | |
if(!isset($format)) { | |
$format="Y/m/d"; | |
} |
View Animation.java
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
protected float resolveSize(int type, float value, int size, int parentSize) { | |
switch (type) { | |
case ABSOLUTE: | |
return value; | |
case RELATIVE_TO_SELF: | |
return size * value; | |
case RELATIVE_TO_PARENT: | |
return parentSize * value; | |
default: | |
return value; |
View TranslateAnimationEx.java
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
public class TranslateAnimationEx extends TranslateAnimation implements | |
AnimationListener { | |
private AnimationListener mListener; | |
private View mView; | |
private int mFromX; | |
private int mFromY; | |
private int mToX; | |
private int mToY; |
View SavePictureRunner
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
public class SavePictureRunner implements Runnable { | |
private File mFileName; | |
private View mView; | |
public SavePictureRunner(View view, File filename) { | |
this.mView = view; | |
this.mFileName = filename; | |
} | |
@Override |
View FlashAirStateChanger.uws
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
dim fso = CREATEOLEOBJ("Scripting.FileSystemObject") | |
for i = 0 to GETOLEITEM(fso.Drives) - 1 | |
// ドライブの検索(リムーバブルかつ、制御用画像が存在するか?) | |
dim d = ALL_OLE_ITEM[i] | |
PRINT d.DriveLetter + ": Type " + d.DriveType | |
IFB d.DriveType = 1 THEN | |
PRINT "found " + d.path | |
dim path = fso.buildPath(fso.buildPath(fso.buildPath(d.path, "DCIM"), "100__TSB"), "FA000001.JPG") | |
PRINT "path " + path | |
IFB fso.FileExists(path) THEN |
View GitCommit.js
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
var wsh = new ActiveXObject("WScript.Shell"); | |
var fso = new ActiveXObject("Scripting.FileSystemObject"); | |
var command = App.ParamCount > 0 ? App.Params(0) : "commit"; | |
var path = fso.buildPath(wsh.RegRead("HKCU\\Software\\GitExtensions\\InstallDir"), "GitExtensions.exe") | |
if(fso.fileExists(path)){ | |
// .gitフォルダを探索 | |
var doc = Documents.newDocument(); | |
if(doc.save()){ | |
var folder = fso.getFolder(fso.getParentFolderName(doc.fileName)) | |
try{ |
View MediaStoreに登録されていない画像である場合
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); |
View サムネイル用の画像を先行表示する
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); |
OlderNewer