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 / gist:1277359
Created October 11, 2011 05:27
fql sample
curl -F 'access_token=XXXX' \
-F 'query=SELECT post_id, created_time,message FROM stream WHERE source_id = 365989369023 and created_time < 1276095600 limit 500' \
-F 'format=json-strings' \
https://api.facebook.com/method/fql.query
@takekazuomi
takekazuomi / gist:1325439
Created October 30, 2011 03:43
how to change x-ms-version header
var context = tables.GetDataServiceContext();
context.SendingRequest += (sender, args) => {
var request = args.Request as HttpWebRequest;
request.Headers["x-ms-version"] = "2011-08-18";
};
<button type="button" onclick="window.location.href = 'https://.blob.core.windows.net/clickonce/Setup.exe';">Download <strong>now</strong>!</button>
$ dig www.contentinstaller.net
; <<>> DiG 9.7.3-P3 <<>> www.contentinstaller.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58800
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;www.contentinstaller.net. IN A
@takekazuomi
takekazuomi / gist:1917252
Created February 26, 2012 15:13
Embed gist
<script src="https://gist.github.com/1325439.js?file=gistfile1.cs"></script>
<div class="gist">https://gist.github.com/1325439</div>
@takekazuomi
takekazuomi / FileBaseProvider.cs
Created February 27, 2012 05:52
Double-checked locking
private static FileSystemWatcherPool sInstance;
private static object sLock = new object();
private FileSystemWatcherPool() {
this.cleanupTimer = new Timer(InvalidateWatcherList, null, OneMinute, OneMinute);
}
public static FileSystemWatcherPool Instance {
get {
if (sInstance == null) {
@takekazuomi
takekazuomi / gist:1957703
Created March 2, 2012 10:55
DeploymentException:The error code was 0x80070020
SyncService [IIS => Local Storage] - Failed to create an MSDeploy package in local storage from updates in IIS.
==============================================================================
DeploymentClientServerException:An error was encountered when processing operation 'Read File' on 'main.swf'.
at Microsoft.Web.Deployment.DeploymentObject.AddChild(DeploymentObject source, Int32 position, DeploymentSyncContext syncContext)
at Microsoft.Web.Deployment.DeploymentSyncContext.HandleAddChild(DeploymentObject destParent, DeploymentObject sourceObject, Int32 position)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncDirPathChildren(DeploymentObject destRoot, DeploymentObject sourceRoot)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncDirPathChildren(DeploymentObject destRoot, DeploymentObject sourceRoot)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncDirPathChildren(DeploymentObject destRoot, DeploymentObject sourceRoot)
at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrde
@takekazuomi
takekazuomi / gist:2291560
Created April 3, 2012 12:25
error in macports
/usr/bin/cc -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED -g -O2 -W -Wall -pedantic -I/Library/Frameworks/Mono.framework/Versions/2.10.9/include -DHAVE_CONFIG_H -I.. -I. -I"/usr/include" -fno-common registry.c -o registry.o
In file included from ../cregistry/registry.h:35,
from registry.c:39:
/Library/Frameworks/Mono.framework/Versions/2.10.9/include/sqlite3.h:252: warning: ISO C90 does not support ‘long long’
/Library/Frameworks/Mono.framework/Versions/2.10.9/include/sqlite3.h:253: warning: ISO C90 does not support ‘long long’
/usr/bin/cc -c -DUSE_TCL_STUBS -DTCL_NO_DEPRECATED -g -O2 -W -Wall -pedantic -I/Library/Frameworks/Mono.framework/Versions/2.10.9/include -DHAVE_CONFIG_H -I.. -I. -I"/usr/include" -fno-common util.c -o util.o
In file included from util.h:36,
from util.c:37:
/Library/Frameworks/Mono.framework/Versions/2.10.9/include/sqlite3.h:252: warning: ISO C90 does not support ‘long long’
/Library/Frameworks/Mono.framework/Versions/2.10.9/include/sqlite3.h:253: war
@takekazuomi
takekazuomi / gist:2715762
Created May 17, 2012 02:28
AsTableServiceQuery trap
void CloudTableQuery001(CloudTableClient tables, string tableName)
{
var context = GetTableServiceContext(tables);
// query is instance of CloudTableQuery
var query1 = context.CreateQuery<EntityOne>(tableName).AsTableServiceQuery();
logger.Info(m=>m("{0}\t{1}", query1 is CloudTableQuery<EntityOne>, query1.GetType().Name));
// now DataServiceOrderedQuery