Skip to content

Instantly share code, notes, and snippets.

View bryanmacfarlane's full-sized avatar

Bryan MacFarlane bryanmacfarlane

View GitHub Profile
@bryanmacfarlane
bryanmacfarlane / installmongo.sh
Last active April 3, 2018 10:19
Install mongodb on mac
# download first. from ~/Downloads directory
sudo mkdir -p /usr/local/bin/mongodb
tar -zxvf mongodb-osx-ssl-x86_64-3.6.1.tgz
sudo mv ./mongodb-osx-x86_64-3.6.1/* /usr/local/bin/mongodb/
cd /usr/local/bin/
sudo ln -s /usr/local/bin/mongodb/bin/mongo mongo
sudo ln -s /usr/local/bin/mongodb/bin/mongod mongod
sudo mkdir -p /data/db
@bryanmacfarlane
bryanmacfarlane / _suite.ts
Last active March 8, 2022 11:03
VSTS Sample Task
import * as path from 'path';
import * as assert from 'assert';
import * as ttm from 'vsts-task-lib/mock-test';
describe('Sample task tests', function () {
before(() => {
});
after(() => {
# ./git4win282.sh gitwin ~/Projects/gitwinout
git_repo_folder_name=$1
build_output_path=$2
BUILD_TAG="tags/v2.8.2.windows.1"
echo "Folder : ${git_repo_folder_name}"
echo "Output : ${build_output_path}"
function banner()
@bryanmacfarlane
bryanmacfarlane / npm-debug.log
Created September 21, 2015 17:49
npm package.json rename EPERM log
This file has been truncated, but you can view the full file.
96048 info install [email protected]
96049 info preinstall [email protected]
96050 verbose unlock done using C:\Users\vsoagentuser\AppData\Roaming\npm-cache\_locks\inherits-e67f15cb2a9abd4e.lock for C:\test\node_modules\gulp-typescript\node_modules\vinyl-fs\node_modules\duplexify\node_modules\readable-stream\node_modules\inherits
96051 verbose readDependencies loading dependencies from C:\test\node_modules\gulp-typescript\node_modules\gulp-util\node_modules\multipipe\node_modules\duplexer2\node_modules\readable-stream\node_modules\string_decoder\package.json
96052 verbose readDependencies loading dependencies from C:\test\node_modules\gulp-typescript\node_modules\gulp-util\node_modules\multipipe\node_modules\duplexer2\node_modules\readable-stream\node_modules\inherits\package.json
96053 verbose readDependencies loading dependencies from C:\test\node_modules\gulp-typescript\node_modules\gulp-util\node_modules\multipipe\node_modules\duplexer2\node_modules\readable-stream\node_modules\isarray\package.json
var util = require('util');
var Q = require('q');
var path = require('path');
var stream = require('stream');
var fs = require('fs');
var NullStream = function () {
stream.Writable.call(this, { objectMode: true });
this._write = function (data, encoding, callback) {
};
@bryanmacfarlane
bryanmacfarlane / gist:cbf864336bc9b6ad6884
Last active August 29, 2015 14:16
Node v0.12 Stream Bug
var path = require('path');
var stream = require('stream');
var fs = require('fs');
var PassThrough = require('stream').PassThrough;
var streamThrough = function(filePath, done) {
var len = 0;
var inputStream = fs.createReadStream(filePath);
@bryanmacfarlane
bryanmacfarlane / messagequeue.js
Last active July 28, 2019 23:23
node.js http long polling server. using a messaging as an example of longpoll usage.
//
// Crude node.js longpoll example via a simple message queue
//
//--------------------
// app.js
//--------------------
var queue = require('./queue/messagequeue');
app.get('/messages/:queueName/:lastMsgId', queue.getMessages);
app.post('/messages/:queueName', queue.postMessages);