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 / server.js
Created June 5, 2014 18:40
An HTTP proxy server written in Node.js
var http = require('http');
var url = require('url');
http.createServer(function(request, response) {
console.log(request.url);
var options = url.parse(request.url);
options.method = request.method;
options.headers = request.headers;
var req = http.request(options, function(res){
@richorama
richorama / test.geojson
Last active August 29, 2015 14:02
GeoJson Test
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richorama
richorama / sample.geojson
Created June 17, 2014 10:07
Example geojson file
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richorama
richorama / Azure Data Centers.geojson
Last active February 12, 2017 12:17
Azure Data Center Locations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richorama
richorama / server.js
Last active August 29, 2015 14:02
Experimental generic http interface for Codename Orleans
/*
Experimental generic http interface for Codename Orleans
To use, POST to this url:
POST /grainType/grainId/grainMethod
[arg1, arg2]
grain response will be in the http response body
@richorama
richorama / makefile
Last active August 29, 2015 14:02
My makefile for browserify and uglify
all: clean lint test build
clean:
rm -f *.min.js
lint: clean
jshint --config jshintconfig.json $(filter-out $(wildcard *.min.js), $(wildcard *.js))
test:
mocha
@richorama
richorama / index.js
Created June 30, 2014 21:25
Playing wav files in Node.js using Edge.js
var edge = require('edge');
var play = edge.func(function () {/*
async (input) => {
(new System.Media.SoundPlayer(input as string)).Play();
return input;
}
*/});
play("pacman_beginning.wav", function (error, result) {
@richorama
richorama / main.cs
Last active August 29, 2015 14:03
FuncGenerator
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
@richorama
richorama / GrainTests.cs
Last active August 29, 2015 14:04
A unit testing class for Orleans Silos
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Orleans.Host.SiloHost;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
namespace Tests
{
[TestClass]
public class GrainTests
@richorama
richorama / gist:efc31af9fcb066f399a6
Created July 28, 2014 11:02
Send a Yo! from Windows Phone 8.1
static async Task<bool> Yo()
{
using (var client = new HttpClient())
using (var mfdc = new MultipartFormDataContent())
{
mfdc.Add(new StringContent("YOUR_API_TOKEN"), name: "api_token");
var response = await client.PostAsync("http://api.justyo.co/yoall/", mfdc);
return response.IsSuccessStatusCode;
}
}