Skip to content

Instantly share code, notes, and snippets.

View tmyt's full-sized avatar
🏠
Working from home

Yutaka TSUMORI tmyt

🏠
Working from home
View GitHub Profile
public static T FindElement<T>(this DependencyObject rootElement, string name = null)
where T : DependencyObject
{
var q = new Queue<DependencyObject>();
q.Enqueue(rootElement);
while (q.Count != 0)
{
var e = q.Dequeue();
if (e is T && (name == null || !(e is FrameworkElement) || (e as FrameworkElement).Name == name)) return e as T;
if (e == null) continue;
public class CachedValue<T>
{
private bool _hasValue;
private T _value;
private Func<T> _getter;
public T Value => _hasValue ? _value : (_value = _getter());
public CachedValue(Func<T> getter)
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
namespace XamlPullToRefresh
{
public class ObservableCollectionEx<T> : ObservableCollection<T>

aristeaでサムネイルになるサービス一覧

  • はてなフォトライフ
  • 携帯百景
  • twitpic (死んだ)
  • yfrog
  • TweetPhoto (死んだ)
  • plixi (死んだ)
  • twipl (死んだ)
  • フォト蔵
  • ついっぷるフォト
@tmyt
tmyt / ndef.cs
Created September 6, 2015 17:10
WinRTでNDEF書いてみる感じ
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using App18;
namespace Ndef
{
public class NdefRecord
{

Aristea shortcut cheat sheet

global

stroke behavior
Ctrl+N New tweet
Ctrl+F Search tweet

compose

#if WINDOWS_PHONE_APP
new FirstFloor.XamlSpy.XamlSpyService(this)
{
RemoteAddress = "192.168.14.53",
RemotePort = 4530,
Password = "21612"
}.StartService();
#endif
RootFilter = new HttpBaseProtocolFilter();
RootFilter.CacheControl.ReadBehavior = Windows.Web.Http.Filters.HttpCacheReadBehavior.MostRecent;
RootFilter.CacheControl.WriteBehavior = Windows.Web.Http.Filters.HttpCacheWriteBehavior.NoCache;
HttpClient = new HttpClient(RootFilter);
static void Main(string[] args)
{
var list = new List<string>
{
"hoge",
"fuga",
"piyo",
"foo",
"hoge",
"bar",
; scale windows store apps visual assets to each scale factor.
(define (uwp-scale-image-duplicate-scale-export inSaveTo inBaseName inImage inWidth inHeight inScaleFactor)
(define w (/ (* inWidth inScaleFactor) 100))
(define h (/ (* inHeight inScaleFactor) 100))
(define img (car (gimp-image-duplicate inImage)))
(define layer (car (vector->list (car (cdr (gimp-image-get-layers img))))))
(define outFile (string-append inSaveTo "/" inBaseName ".scale-" (number->string inScaleFactor) ".png"))
(gimp-image-scale img w h)
(file-png-save2 1 img layer outFile outFile 0 9 1 0 0 0 0 0 0)