Skip to content

Instantly share code, notes, and snippets.

@miya2000
miya2000 / CodeFixProvider.cs
Created August 5, 2015 16:27
nest ".ValueChanged.cs" file.
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(ValueChangedGaneratorCodeFixProvider)), Shared]
public class ValueChangedGaneratorCodeFixProvider : CodeFixProvider
{
// snip.
public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
{
var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
var diagnostic = context.Diagnostics.First();
@miya2000
miya2000 / UnitTest1.cs
Created August 5, 2015 10:48
protected access modifier difference between Java and C#.
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
// ==UserScript==
// @name tugino renkyu for Opera10.10
// @include http://misc.tokyoenvious.net/holidays/holidays.html
// ==/UserScript==
(function() {
if (parseFloat(opera.version()) >= 12) return;
if (!window.console) {
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="EnvDTE" #>
<#@ import namespace="System.Linq" #>
<#@ output extension=".txt" #>
<#
var dte = ((IServiceProvider)this.Host).GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
var runContextTest = dte.Commands.Item("{1E198C22-5980-4E7E-92F3-F73168D1FB63}", 885);
if (x < 0) { /**/ }
else if (x === 0) { /**/ }
else if (x > 0) { /**/ }
else { /**/ }
@miya2000
miya2000 / test
Created April 15, 2014 23:00
Excel2013: Odd FormulaR1C1 When Activating Graph sheet.
Sub Test()
Sheet1.Activate
ShowR1C1ToA1 ("=RC[-1]") ' [=A1]
Graph1.Activate
ShowR1C1ToA1 ("=RC[-1]") ' [=XFD1]
End Sub
// ==UserScript==
// @name Amanzon immersiveView for Opera10.10
// @include http://www.amazon.co.jp/exec/obidos/ASIN/*
// ==/UserScript==
(function() {
opera.addEventListener('BeforeScript', function(e) {
if (e.element.src.indexOf('immersiveView') >= 0) {
e.element.text = e.element.text.replace('jQuery("<img>").attr("src",currentDetailImageUrl);', 'jQuery("<img>").load(function(){}).attr("src",currentDetailImageUrl)');
}
}, false);
@miya2000
miya2000 / nicovideo_wnp.user.js
Created December 23, 2013 23:54
nicovideo - wnp (Ginza Preview)
// ==UserScript==
// @name nicovideo - wnp (Ginza Preview)
// @description windowised nicovideo player.
// @author miya2000
// @namespace http://d.hatena.ne.jp/miya2000/
// @version Ginza Preview
// @include http://*.nicovideo.jp/*
// @exclude http://www.nicovideo.jp/watch/*
// @exclude http://*http*
// @exclude http://ads.nicovideo.jp/*
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
namespace UnitTestProject1
{
[TestClass]
public class CsvConvertUsingAnonymousTypeTest
// ==UserScript==
// @name jQuery2.0.0 for Opera10.10
// @include *
// ==/UserScript==
(function() {
if (typeof Date.now == 'undefined') {
Date.now = function() { return new Date() };
}
if (typeof Array.isArray == 'undefined') {
// https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Array/isArray