Skip to content

Instantly share code, notes, and snippets.

{
"name": "sample",
"description": "A sample package",
"version": "0.0.0",
"author": "Tim Chaplin <[email protected]>",
"repository": {
"type": "git",
"url": "https://github.com/<SOMEPROJECTNAME>.git"
},
"homepage": "https://github.com/<SOMEPROJECTNAME>.git",
@tjchaplin
tjchaplin / nodeAndBrowserFunction.js
Created July 16, 2013 22:23
Run method in node and in browser
(function(window){
"use strict";
console.log(window);
})(typeof global == 'object' && global || this);
@tjchaplin
tjchaplin / killNode.md
Created August 19, 2013 15:45
Kill Node App on remote server

#Kill node processes

##Kill all node processes

killall node 

##Kill specfic node process

@tjchaplin
tjchaplin / gist:8846073
Created February 6, 2014 15:13
Mongodb - Add BsonType information based on Convention
private static void RegisterBsonClassMappings()
{
//AnyBaseClass is defined as a root
BsonClassMap.RegisterClassMap<AnyBaseClass>(cm =>
{
cm.AutoMap();
cm.SetIsRootClass(true);
});
//IAnyInterface is a marker interface which falls in the inheritence tree for
@tjchaplin
tjchaplin / gist:621edccbfddc0d3526b5
Created January 23, 2015 11:00
Update Teamcity Build Number based on package.json - (Powershell <= 2)
# These are project build parameters in TeamCity
# Depending on the branch, we will use different major/minor versions
[System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
$ser = New-Object System.Web.Script.Serialization.JavaScriptSerializer
$json = Get-Content "package.json" | Out-String
$obj = $ser.DeserializeObject($json)
$majorVerion = ($obj['version'] -split "\.")[0]
$minorVerion = ($obj['version'] -split "\.")[1]
$buildCounter = "%teamcity.build.counter%"
$buildNumber = "$majorVerion.$minorVerion.$buildCounter"