Skip to content

Instantly share code, notes, and snippets.

View pflannery's full-sized avatar

Peter Flannery pflannery

  • London, United Kingdom
View GitHub Profile
FROM mcr.microsoft.com/powershell:lts-7.2-nanoserver-ltsc2022
ARG NODE_ZIP=https://nodejs.org/dist/v20.14.0/node-v20.14.0-win-x64.zip
ARG NODE_PATH="C:\Program Files\nodejs"
# add node to PATH
ENV PATH "C:\Windows\system32;C:\Program Files\PowerShell;${NODE_PATH}"
# download nodejs
RUN curl.exe -o node.zip %NODE_ZIP%
RUN mkdir "%NODE_PATH%"
# output commits that are not yet in the master branch in csv format
# Date,Commit,User,Description
git log --oneline --date=human --pretty=format:'%ad,%h,%an,%s' dev ^master
@pflannery
pflannery / setup-c#7-with-unity2018-2.md
Last active January 26, 2020 00:02
Setup C# 7.x compilation in Unity 2018.2 and Visual Studio 2017

Set the unity scripting runtime to ".NET 4.x Equivalent"

In Unity goto "Edit->Preferences->Player" then find and set "Scripting Runtime Version*" to ".NET 4.x Equivalent"

Install Unity's IncrementalCompiler

In Unity:

  • Goto "Window->Package manager->All" then find and install the IncrementalCompiler
  • Goto "Unity Preferences->Compiler" and set "Enable building from IDE" to True
@pflannery
pflannery / fibonacci.js
Created April 13, 2015 17:43
Memoize Fibonacci
function() {
var fibMemo = [0, 1];
function fib(n) {
var f;
for (var k = fibMemo.length; k <= n; k++) {
f = fibMemo[k - 1] + fibMemo[k - 2];
fibMemo[k] = f;
}
return f || fibMemo[n];
}
@pflannery
pflannery / app.js
Last active January 3, 2016 11:52
Yuidoc example
/**
* ###library 6000 test
*
* @module library6000
*/
/**
* Some class
*
* @class SomeClass
@pflannery
pflannery / three-heap-snapshots.js
Last active August 30, 2018 12:19
Comparing heaps for TaskGroup
'use strict'
let TaskGroup = require('./taskgroup')
let util = require('./util')
let mode = 'heap'
let testname = 'taskgroup-profile-test'
// Start profiling
if ( mode === 'profile' ) util.startProfile(testname)
@pflannery
pflannery / taskgroup-cpuprofiling.js
Last active August 29, 2015 14:17
Generate CPU profile for node
var fs = require('fs'),
profiler = require('v8-profiler');
function saveHeapSnapshot(fileName) {
var buffer = '';
var snapshot = profiler.takeSnapshot("test");
snapshot.serialize(
function iterator(data, length) {
buffer += data;
},function complete(){