Skip to content

Instantly share code, notes, and snippets.

View robashton's full-sized avatar
🍻
drinking

His Excellence Sir Professional of Rob upon Ashtonburyshirester robashton

🍻
drinking
View GitHub Profile
@robashton
robashton / blah.js
Created June 17, 2011 09:56
Example
System.Windows.Application.prototype._ctor$1 = function (nativeTypeIndex) {
System.Object.prototype._ctor.call(this);
System.Windows.Application._current = this;
var intPtr = System.IntPtr.Zero;
intPtr = $asm02.MS.Internal.XcpImports.CreateObjectByTypeIndex(nativeTypeIndex);
this.m_nativePtr = new $asm02.MS.Internal.NativeObjectSafeHandle();
this.m_nativePtr.NativeObject = intPtr;
$asm02.MS.Internal.ManagedPeerTable.Add$0(intPtr, this);
this._coreTypeEventHelper = new $asm02.MS.Internal.CoreTypeEventHelper();
var type = (JSIL.GetType(this));
@robashton
robashton / BloatedController.cs
Created June 13, 2011 16:32
Partially Refactored controller
public class ReducedController : Controller
{
private readonly IContainProducts productRepository;
private readonly ISearchForProducts productsIndex;
private readonly IContainCustomers customerRepository;
private readonly IShipProducts productShipper;
private readonly ICoordinateSales salesCatalog;
public ReducedController(
IContainProducts productRepository,
@robashton
robashton / cruft.cs
Created June 13, 2011 16:14
ASP.NET Cruft
[HttpPost]
public ActionResult DoSomethingCool()
{
if (Session["water"] == "boiling")
{
Server.TransferRequest("~/408.aspx");
}
return View();
}
var fs = require('fs');
fs.readFile('hello.txt', function(err, data) {
response.write(data);
response.end();
});
@robashton
robashton / gist:929593
Created April 19, 2011 20:38
shader.shader
attribute vec3 aVertexPosition;
attribute vec3 aNormal;
attribute vec2 aTextureCoord;
uniform mat4 uProjection;
uniform mat4 uView;
uniform mat4 uWorld;
uniform mat3 uNormal;
uniform vec3 vLight;
@robashton
robashton / methodssearch.cs
Created April 4, 2011 20:45
Finding the method being loaded
var actualCall = dynamicMethodCalls.Last();
var current = actualCall.Previous;
if(current.OpCode.Code == Code.Ldstr)
{
columnType = typeof (string);
}
@robashton
robashton / Check.cs
Created April 4, 2011 20:42
The model we're analysing
Instruction[] dynamicMethodCalls = ExtractDynamicMethodCallInstructions();
if (dynamicMethodCalls.Length == 0) { return; }
Instruction[] cachedReflectedFields = ExtractInitialReflectedCachedFieldReferenceInstructions();
if (cachedReflectedFields.Length == 0) { return; }
Hey,
you seem to be an expert in WebGl.Could you send me a code for super mario game in webgl,written in js?..This has been bugging me for a while,please see if you can help.
var timeAtLastFrame = new Date().getTime();
var idealTimePerFrame = 1000 / 30;
var leftover = 0.0;
var frames = 0;
function runApplication(){
setInterval(tick, 1000/30);
}
function tick() {
@robashton
robashton / gist:874187
Created March 17, 2011 11:33
Another naive game loop
function runApplication(){
setInterval(doGameLoop}, 1000 / 30);
}
function doGameLoop(){
doLogic();
renderScene();
}