Skip to content

Instantly share code, notes, and snippets.

class VicHUD extends MobileHUD;
defaultproperties
{
}
class VicGame extends FrameworkGame;
defaultproperties
{
PlayerControllerClass=class'VicGame.VicPlayerController'
DefaultPawnClass=class'VicGame.VicPawn'
HUDType=class'VicGame.VicHUD'
bDelayedStart=false
}
string cssUrl = Server.MapPath("~/css/contract.css");
return new PdfResult("Contract.pdf",
myContractText,
new string[] { cssUrl });
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PDFBuilder;
using iTextSharp.text;
namespace SweetApp.Web
{
@mattkruskamp
mattkruskamp / global.asax.cs
Created March 8, 2011 23:20
Binding of the web service
routes.Add(new ServiceRoute("api/v1/test",
new NinjectServiceHostFactory(), typeof(TestService)));
@mattkruskamp
mattkruskamp / NinjectWebServiceHostFactory.cs
Created March 8, 2011 23:15
A web service host factory that utilizes the library.
public NinjectWebServiceHostFactory()
{
_kernel = NinjectKernel.Instance.Kernel; // point to your kernel
}
@mattkruskamp
mattkruskamp / testservice2.cs
Created March 8, 2011 23:09
With the new constructor
IUserRepository userRepo;
public TestService(IUserRepository userRepo)
{
this.userRepo = userRepo;
}
@mattkruskamp
mattkruskamp / testservice.cs
Created March 8, 2011 23:07
WCF Rest Service
[ServiceContract]
[AspNetCompatibilityRequirements(
RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
public class TestService
{
[Description("Test Description.")]
[WebGet(UriTemplate = "go")]
public string Test()
{
@mattkruskamp
mattkruskamp / dive.js
Created February 23, 2011 23:56
Calling the dive
// standard jquery self-calling function
jQuery(function () {
// get the elements
var psiIn = $("#psiIn"),
psiOut = $("#psiOut"),
time = $("#time"),
depth = $("#depth"),
tankVolume = $("#tankVolume"),
tankWorkingPsi = $("#tankWorkingPsi"),
finalLabel = $("#rate"),
@mattkruskamp
mattkruskamp / dive.js
Created February 23, 2011 23:47
Simple Script for Dive Calculation
// Namespace to DevelopLive
DevelopLive = window.DevelopLive || {};
// Define Dive
DevelopLive.Dive = window.DevelopLive.Dive || {};
(function () {
$self = DevelopLive.Dive;
$self.calcSac = function(psiIn, psiOut, time,