Skip to content

Instantly share code, notes, and snippets.

View takekazuomi's full-sized avatar
:octocat:
on code

Takekazu Omi takekazuomi

:octocat:
on code
View GitHub Profile
@takekazuomi
takekazuomi / TableDumpJson.Program.cs
Created January 30, 2014 06:52
Dump Azure Table in JSON format
using System;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth.Protocol;
using Microsoft.WindowsAzure.Storage.Core;
using Microsoft.WindowsAzure.Storage.Core.Auth;
ErrorCode<ERRCA0017>:SubStatus<ES0007>:There is a temporary failure. Please retry later. (The request failed because the server is in throttled state)
using System;
using System.Runtime.CompilerServices;
namespace Snowflake001
{
public class IdWorker
{
private static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
private const long TwEpoch = 1288834974657L;
@takekazuomi
takekazuomi / TestMsgpackCli001.cs
Created April 10, 2014 00:10
Message Pack CLI issue #27 reproducible code
using System;
using System.IO;
using System.Linq;
using MsgPack.Serialization;
namespace TestMsgpackCli001
{
using System.Collections.Generic;
namespace TestMsgpackCli001
@takekazuomi
takekazuomi / .gitattributes
Created April 17, 2014 05:49
.gitattributes for Windows
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.bat text
*.config text
*.cmd text
*.cs text
*.csproj text
*.licenseheader text
# TCP tune script
function SetPropertyDWORD([string]$path, [string]$key, [string]$Value) {
$oldValue = "0x{0:X}" -f (Get-ItemProperty -path $path).$key
if($Value -eq $oldValue)
{
return $false;
}
Set-ItemProperty -path $path -name $key -Type DWORD -Value $Value
$newValue = (Get-ItemProperty -path $path).$key
@takekazuomi
takekazuomi / azure.err
Created May 18, 2014 11:27
Error: Storage account wufoomibench04a4 has container(s) which have an active image and/or disk artifacts. Ensure those artifacts are removed from the image repository before deleting this storage account.
vagrant@precise64:/vagrant/bootstrap2$ cat azure.err
Sun May 18 2014 04:20:48 GMT-0700 (PDT):
{ [Error: Storage account wufoomibench04a4 has container(s) which have an active image and/or disk artifacts. Ensure those artifacts are removed from the image repository before deleting this storage account.]
stack: [Getter/Setter],
code: 'BadRequest',
statusCode: 400,
requestId: '5b45d15596aea758b61bdda2645d5d7e',
__frame:
{ name: 'storageAccount_deleteCommand__5',
line: 146,
@takekazuomi
takekazuomi / razure
Created May 22, 2014 00:25
retry wrapper script for azure xplat tools
#!/bin/bash -u
declare -i retries=${1:?"no retry count"}
shift
declare -i time_wait=${1:?"no time out sec"}
shift
declare result_code=0
for i in $(seq 0 $retries); do
/usr/bin/azure "$@"
package main
import {
"fmt",
}
func main() {
m := map[string]int {
"hoge":100,
"fuga":200,
@takekazuomi
takekazuomi / emacs.ps1
Last active August 29, 2015 14:02
emacs startup helper for windows emacs
$EMACS_HOME="C:\opt\emacs-24.3-20130503"
$Env:Path = "$EMACS_HOME\bin;$Env:Path"
function emacs() {
param([string[]]$p = ".");
$emacs_server_path = "~/.emacs.d\server\server"
if (test-path $emacs_server_path) {
$s=Get-Content "$emacs_server_path"
$s[0] -match "^([0-9\.]+):([0-9]+) ([0-9]+)"