Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Work from home

Kiyoaki Tsurutani kiyoaki

🏠
Work from home
View GitHub Profile
@kiyoaki
kiyoaki / AzureBlobCopyBatch.cs
Last active Aug 29, 2015
Azure blob storage coping from another storage account blob
View AzureBlobCopyBatch.cs
using System;
using System.IO;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
namespace AzureBlobBatch
{
class Program
{
static void Main(string[] args)
@kiyoaki
kiyoaki / AssetBundleNameGenerator.cs
Created May 21, 2015
How to set AssetBundleName from editor scripts.
View AssetBundleNameGenerator.cs
public class AssetBundleNameGenerator
{
[MenuItem("AssetBundles/Set XXX")]
public static void SetXXX()
{
foreach (var file in Directory
.GetFiles("Assets/XXX/XXX/",
"*.xxx", SearchOption.TopDirectoryOnly))
{
var importer = AssetImporter.GetAtPath(file);
View ComputerVisionApiController.cs
using System.Threading.Tasks;
using System.Web.Http;
using Microsoft.ProjectOxford.Vision;
using Microsoft.ProjectOxford.Vision.Contract;
namespace ComputerVisionAPI.Controllers
{
public class ComputerVisionApiController : ApiController
{
public async Task<AnalysisResult> Get(string url)
View GoogleVisionApiController.cs
using System.Linq;
using System.Threading.Tasks;
using System.Web.Http;
using Google.Apis.Services;
using Google.Apis.Vision.v1;
using Google.Apis.Vision.v1.Data;
namespace ComputerVisionAPI.Controllers
{
public class GoogleVisionApiController : ApiController
View BigQueryStreaming.cs
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Google.Apis.Util;
namespace SampleApp.BigQuery.Actions
{
public static class BigQueryStreaming
View UserActionSankeyDiagramApiController.cs
using System;
using System.Linq;
using System.Web.Http;
using BigQuery.Linq;
using SampleApp.BigQuery;
using SampleApp.BigQuery.Tables.Statistics;
using WebApi.OutputCache.V2;
namespace SampleApp.Admin.Controllers
{
View UserActionLogMiddleware.cs
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Owin;
namespace SampleApp.Core.OwinMiddlewares
{
public class UserActionLogMiddleware : OwinMiddleware
{
// このパスにアクセスが来たらログ採取開始
View UserActionSankeyDiagram_Index.cshtml
@model UserActionSankeyDiagramViewModel
@{
ViewBag.Title = "ユーザーの行動";
}
<h2>ユーザーの行動(BigQuery ※1日キャッシュ)</h2>
<div class="padding-top-10"></div>
@using (Html.BeginForm("Index", "UserActionSankeyDiagram", FormMethod.Get, new { role = "form" }))
View TechnicalAnalysisFormula.cs
using System;
using System.Collections.Generic;
using System.Linq;
public static class TechnicalAnalysisFormula
{
public static double Rsi(double[] source, int period)
{
if (source == null) throw new ArgumentNullException(nameof(source));
if (source.Length <= period) throw new ArgumentException(nameof(source) + ".Length <= period");
@kiyoaki
kiyoaki / windows-docker-commands
Last active Jun 29, 2017
Windows docker commands
View windows-docker-commands
# stop all containers
FOR /f "tokens=*" %i IN ('docker ps -a -q') DO docker stop %i
# delete all containers
FOR /f "tokens=*" %i IN ('docker ps -a -q') DO docker rm %i
# delete all images
FOR /f "tokens=*" %i IN ('docker images -a -q') DO docker rmi -f %i