Skip to content

Instantly share code, notes, and snippets.

View ducas's full-sized avatar

Ducas Francis ducas

  • Readify
  • Sydney, Australia
View GitHub Profile
@BinaryMuse
BinaryMuse / restful.js
Last active March 17, 2019 08:22
Express API with Async/Await
import express from "express";
/**
* Takes a route handling function and returns a function
* that wraps it after first checking that the strings in
* `reserved` are not part of `req.body`. Used for ensuring
* create and update requests do not overwrite server-generated
* values.
*/
function checkReservedParams(routeHandler, ...reserved) {
@jstangroome
jstangroome / TeamBuildNumber.targets
Created February 14, 2014 22:32
An MSBuild targets file to retrieve the Team Build Number for TFS 2012. Just <Import> this targets file and specify DependsOnTargets="TeamBuildNumber" in your <Target>.
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="TeamBuildNumber">
<GetTeamBuildNumber TeamFoundationServerUrl="$(TeamFoundationServerUrl)" BuildUri="$(BuildUri)" ContinueOnError="true">
<Output TaskParameter="TeamBuildNumber" PropertyName="TF_BUILD_BUILDNUMBER" />
</GetTeamBuildNumber>
</Target>
@jstangroome
jstangroome / Send-RemotingFile.ps1
Created January 22, 2011 13:04
Transfers a single file to another machine via the PowerShell Remoting protocol
#requires -version 2.0
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string]
$ComputerName,
[Parameter(Mandatory=$true)]
[string]