Skip to content

Instantly share code, notes, and snippets.

View buchizo's full-sized avatar
🍤
( ´・ω・)つΣ;:',;',',:'',:',;',',)

kosmos.ebi buchizo

🍤
( ´・ω・)つΣ;:',;',',:'',:',;',',)
View GitHub Profile
@buchizo
buchizo / function.json
Last active May 29, 2016 19:21
Blob Bindings using Stream
{
"bindings": [
{
"name": "myBlob",
"type": "blobTrigger",
"direction": "in",
"path": "incontainer/{name}",
"connection": "buchifunctions_STORAGE"
},
{
@buchizo
buchizo / get-bearertoken.ps1
Created February 29, 2016 04:09
get-bearertoken from Azure using AzurePowerShell
$adal = "${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.dll"
$adalforms = "${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll"
[System.Reflection.Assembly]::LoadFrom($adal)
[System.Reflection.Assembly]::LoadFrom($adalforms)
$adTenant = "buchizomsdn.onmicrosoft.com"
# well-known ID
$clientId = "1950a258-227b-4e31-a9cf-717495945fc2"
$redirectUri = "urn:ietf:wg:oauth:2.0:oob"
$resourceAppIdURI = "https://management.core.windows.net/"
$authority = "https://login.windows.net/$adTenant"
var factory = MessagingFactory.Create(ServiceBusEnvironment.CreateServiceUri("sb", "test", ""), new MessagingFactorySettings()
{
TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(SasKeyName, SasKey),
TransportType = TransportType.Amqp
});
var eventHubClient = factory.CreateEventHubClient(EventHubName);
var group = eventHubClient.GetDefaultConsumerGroup();
var reciver = group.CreateReceiver(state.ToString());
while (true)
{
@{
ViewBag.Title = "Index";
}
@model MvcApplication1.Models.HomeViewModel
<h2>Index</h2>
@using (Html.BeginForm("Index", "Home", FormMethod.Post))
{
<input type="submit" />
@buchizo
buchizo / gist:943339609b0a5fbbf229
Created January 6, 2015 20:55
PowerShellでBase64でエンコードされたMD5なハッシュ値を表示する方法(BlobのContentMD5を変換する方法)
[System.BitConverter]::ToString([convert]::FromBase64String("base64な文字列")).ToUpper().Replace("-","")
function ConvertFrom-Base64 {
param([string]$Base64String)
$hex = foreach ($b in [convert]::FromBase64String($Base64String)) {
"{0:x2}" -f $b
}
-join $hex
}
@buchizo
buchizo / gist:f674bb5010a76f03cc06
Created August 20, 2014 18:50
Azure Webサイトのフォント一覧(多分)
PS D:\home> [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
PS D:\home> $objFonts = New-Object System.Drawing.Text.InstalledFontCollection
$objFonts.Families
PS D:\home>
Name
----
@buchizo
buchizo / gist:be7b9d491efce69f98b9
Created August 18, 2014 22:25
ページ内のWebVTTを開くbookmarklet(手抜き)
javascript:(window.open(document.getElementsByTagName('track')[0].getAttribute('src')))
@buchizo
buchizo / gist:8130816
Created December 26, 2013 07:23
posh-gitのプロンプト変更
. '~\Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1'
$global:GitPromptSettings.BeforeText = ' on '
$global:GitPromptSettings.BeforeForegroundColor = [ConsoleColor]::White
$global:GitPromptSettings.AfterText = " `ngit"
@buchizo
buchizo / gist:6423257
Created September 3, 2013 12:26
ざっくりAzure BlobへのUpload
using System.IO;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
using System;
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{