Skip to content

Instantly share code, notes, and snippets.

View papeMK2's full-sized avatar

Tsubasa Yoshino papeMK2

  • Sigma Consulting
  • Japan Tokyo
View GitHub Profile
@papeMK2
papeMK2 / program.cs
Last active August 29, 2015 14:00
LotateImage
private static byte[] LotateImage(byte[] image)
{
var converter = new ImageConverter();
var img = (Image)converter.ConvertFrom(image);
var bmp = new Bitmap(img);
var props = bmp.PropertyItems;
for (int i = 0; i < props.Length; i++)
{
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace publish
{
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Owin;
using Owin;
[assembly: OwinStartupAttribute(typeof(SignalRServerSample.Startup))]
<Page
x:Class="XamlTraining.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XamlTraining"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource FocusVisualWhiteStrokeThemeBrush}">
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using Newtonsoft.Json;
using System.Net.Http;
@papeMK2
papeMK2 / gist:6f881e0203ddbdc0b1e0
Created June 10, 2015 14:53
UWP用のBluetooth設定をしたpackage.appmanifest
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="3c689bab-1e0a-4d03-91b6-49b0e0d81947" Publisher="CN=Tsubasa" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="3c689bab-1e0a-4d03-91b6-49b0e0d81947" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Band</DisplayName>
@papeMK2
papeMK2 / EnumExtensionForWinRT.cs
Last active February 5, 2016 03:51
EnumExtensionForWinRT.cs
/// <summary>
/// Enumの拡張クラス
/// </summary>
public static class EnumExtention
{
/// <summary>
/// DisplayのNameを返す
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
<p><a href="mailto:info@contso.com?subject=問い合わせ" class="btn btn-primary btn-lg">送信</a></p>
$StorageAccountName = "Storage Account Name"
$StorageAccountKey = "Storage Account Access Key"
$ContainerName = "Container Name"
$fileName = "Filtering file name"
$Context = New-AzureStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
$Container = Get-AzureStorageContainer -Context $context -Name $ContainerName
@papeMK2
papeMK2 / GetCreditCardBrand.js
Last active May 17, 2018 03:13
渡されたクレジットカードのブランドを返す
function GetCardBrand(cardNo) {
var map = new Map();
map.set("visa", "^4[0-9]{12}(?:[0-9]{3})?$");
map.set("master", "^5[1-5][0-9]{14}$");
map.set("amex", "^3[47][0-9]{13}$");
map.set("diners", "^3(?:0[0-5]|[68][0-9])[0-9]{11}$");
map.set("jcb", "^(?:2131|1800|35\d{3})\d{11}$");
for (var [key, value] of map) {
var result = cardNo.match(value);