Skip to content

Instantly share code, notes, and snippets.

View richorama's full-sized avatar
💭
:octocat: 👾 🔥 ☁️

Richard Astbury richorama

💭
:octocat: 👾 🔥 ☁️
View GitHub Profile
@richorama
richorama / gist:2923167
Created June 13, 2012 09:59
Simple class to create and write to performance counters
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace Two10.Utils
{
public class PerformanceMonitor : IDisposable
{
string counterCategory = null;
@richorama
richorama / gist:3690582
Created September 10, 2012 12:10
Writing to a Windows Azure Storage Queue from Mobile Services
var request = require('request');
var crypto = require('crypto');
var url = require('url');
function insert(item, user, request) {
put_message(account, 'queuename', item.text);
request.execute();
}
var account = {
@richorama
richorama / index.htm
Created January 7, 2013 16:15
Drop this file into a *public* Windows Azure Blob Storage Container, and open the page in your browser. It will display a list of the blobs for you.
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://jquery-xml2json-plugin.googlecode.com/svn/trunk/jquery.xml2json.js"></script>
<script src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.rc.1.js"></script>
</head>
<body>
<script>
$(document).ready(function() {
@richorama
richorama / index.html
Last active July 26, 2017 09:18
Programmatically determine your nearest Windows Azure Data Centre
<html>
<head>
<script>
var locations = {
"speedtestwe": "West Europe",
"speedtestsea" : "Southeast Asia",
"speedtestea": "East Asia",
"speedtestnsus": "North Central US",
"speedtestne": "North Europe",
"speedtestscus": "South Central US",
@richorama
richorama / ReportingService2010.cs
Created October 3, 2013 08:39
The proxy for Reporting Service 2010 Web Service
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
# More information on Python SDK for Windows Azure
# http://www.windowsazure.com/en-us/develop/python/how-to-guides/service-management/
from azure import *
from azure.servicemanagement import *
import time
import base64
subscription_id = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
certificate_path = 'mycert.pem'
@richorama
richorama / package.json
Last active April 8, 2016 14:35
A github service hook to start a VM, and shut it down after 15 minutes of inactivity
{
"name": "vmstartstop",
"version": "0.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "",
@richorama
richorama / demo.cs
Created January 7, 2014 12:03
Download files from Visual Studio Online
var netCred = new NetworkCredential("username", "password");
var basicCred = new BasicAuthCredential(netCred);
var tfsCred = new TfsClientCredentials(basicCred);
tfsCred.AllowInteractive = false;
var tfs = new TfsTeamProjectCollection(new Uri("https://XXX.visualstudio.com/DefaultCollection/"), tfsCred);
tfs.Authenticate();
var vcs = tfs.GetService<VersionControlServer>();
@richorama
richorama / Program.cs
Last active January 4, 2016 14:59
Very simple benchmark to see whether its better to compile .NET for x64 for x86 (x86 is faster)
/*
Very simple benchmark to see whether its better to compile .NET for x64 for x86
Results on my Lenovo X1 Core i5 pro running on high performance mode
Compiled for release x64
999ms
1017ms
1031ms
@richorama
richorama / talk.md
Created February 28, 2014 17:29
Nodejs + LevelDB Talk

Intro into level db

https://code.google.com/p/leveldb/

  • It's a database, it's by google, and is what supports IndexDB in the chrome browser
  • It's also been used to store data in riak
  • It lives in your process (a bit like sqlite)
  • Inspired by Big Table, but designed to work on mobile devices
  • There is great support for leveldb in the node.js
  • Node is a great tool for sticking technologies together