Skip to content

Instantly share code, notes, and snippets.

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

kosmos.ebi buchizo

🍤
( ´・ω・)つΣ;:',;',',:'',:',;',',)
View GitHub Profile
@buchizo
buchizo / gist:be7b9d491efce69f98b9
Created August 18, 2014 22:25
ページ内のWebVTTを開くbookmarklet(手抜き)
javascript:(window.open(document.getElementsByTagName('track')[0].getAttribute('src')))
@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: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
}
@{
ViewBag.Title = "Index";
}
@model MvcApplication1.Models.HomeViewModel
<h2>Index</h2>
@using (Html.BeginForm("Index", "Home", FormMethod.Post))
{
<input type="submit" />
@buchizo
buchizo / gist:2650720
Created May 10, 2012 02:55
Convert to DateTimeOffset from Json Date(Unix epoch)
/// <summary>
/// Convert to DateTimeOffset from Json Date(Unix epoch)
/// </summary>
/// <param name="jsondate">ex: "/Date(1324707957994+0900)/"</param>
/// <returns></returns>
public Nullable<DateTimeOffset> ConvertToDateTimeOffsetFromJsonDate(string jsondate)
{
if (String.IsNullOrEmpty(jsondate)) return null;
Regex regex = new System.Text.RegularExpressions.Regex(@"^\/date\((\d*)([\+\-]?\d*)\)\/+$");
using System;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
// http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html
using System;
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
@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)
{
@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"
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)
{