Skip to content

Instantly share code, notes, and snippets.

@denmerc
denmerc / sample.fsx
Created January 6, 2016 22:13
sample fsx
#load "FsLab.fsx"
#load "Vega/Vega.fsx"
#load "Excel/Excel.fsx"
open System
open System.Linq
open Excel
open VegaHub
open FsLab
open Deedle
@denmerc
denmerc / FilesystemWatchCache.cs
Created December 28, 2015 07:40 — forked from anaisbetts/FilesystemWatchCache.cs
An Rx-friendly Filesystem Watcher
using System;
using System.IO;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using ReactiveUI;
namespace SaveAllTheTime.Models
{
interface IFilesystemWatchCache
{
@denmerc
denmerc / markdown.css
Last active August 29, 2015 14:21 — forked from imjasonh/markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}

install the ELK stack on an ubuntu-x64 machine on Azure

This guide has been revised 06-03-2015. Start with a clean ubuntu 14.04LTS-x64 machine and get it updated

sudo su
apt-get update && apt-get dist-upgrade
reboot
@denmerc
denmerc / _.md
Created June 29, 2014 18:50
home portal
open Microsoft.FSharp.Linq
open Microsoft.FSharp.Linq.Query
open MongoDB.Driver
open MongoDB.Linq
let inline (?) this key =
( ^a : (member get_Item : ^b -> ^c) (this,key))
let inline (?<-) this key value =
( ^a : (member set_Item : ^b * ^c -> ^d) (this,key,value))
#if INTERACTIVE
#I @"C:\Tools\MongoDB-CSharp\MongoDB.Linq\bin\Debug"
#r "MongoDB.Driver.dll"
#r "MongoDB.Linq.dll"
#r "FSharp.PowerPack.Linq.dll"
#r "System.Core.dll"
#endif
open System
open MongoDB.Driver
function Invoke-NodeJS {
param(
$PowerShellCommand,
[Switch]$ReturnAsJSON
)
if($ReturnAsJSON) {$PowerShellCommand += " | ConvertTo-Json"}
$tmp = [IO.Path]::GetTempFileName()
var Db = require('mongodb').Db;
var Connection = require('mongodb').Connection;
var Server = require('mongodb').Server;
//the MongoDB connection
var connectionInstance;
module.exports = function(callback) {
//if already we have a connection, don't connect to database again
if (connectionInstance) {
callback(connectionInstance);
var cluster = require('cluster');
var PORT = +process.env.PORT || 1337;
if (cluster.isMaster) {
// In real life, you'd probably use more than just 2 workers,
// and perhaps not put the master and worker in the same file.
cluster.fork();
cluster.fork();
cluster.on('disconnect', function(worker) {