Skip to content

Instantly share code, notes, and snippets.

@bobbychopra
bobbychopra / ConfluenceClientUtil.cs
Created June 1, 2012 13:55
Confluence (XML-RPC) Client code to access and create new page with permissions
public const string SECTION_OWNER_TEXT = "I AM A PARENT PAGE";
public static IEnumerable<RemotePage> getWeeklyParentPages(this ConfluenceClient client, string token, RemotePageSummary[] pages)
{
var pageContent = pages.Select(p => client.getPage(token, p.id));
var weeklyParentPages = pageContent.Where(p => p.content.Contains(SECTION_OWNER_TEXT));
return weeklyParentPages;
}
@bobbychopra
bobbychopra / notify.cs
Created June 8, 2012 11:57
Notify Property Changed using Expression Tree
private string _filePath;
public string FilePath
{
get { return _filePath; }
set { _filePath = value; NotifyOfPropertyChange(()=> FilePath); }
}
private void NotifyOfPropertyChange<TValue>(Expression<Func<TValue>> propertySelector)
{
@bobbychopra
bobbychopra / PMUs.json
Created July 13, 2012 22:10
JSON Deserialize
[
{
"pmu":"Capital Markets",
"list":[
{
"fund":"AAA",
"strategy":"US Capital Markets"
},
{
"fund":"BBB",
@bobbychopra
bobbychopra / filereader.cs
Created July 30, 2012 16:16
File Reader: does not throw process is using file error
// DO THIS
using (var filestream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var reader = new StreamReader(filestream))
{
records = reader.ReadToEnd();
reader.Close();
}
@bobbychopra
bobbychopra / EnumerableToDataTable.cs
Created October 9, 2012 13:29
Converts a Generic Enumerable to a DataTable
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
namespace ConsoleApplication
{
public static class DataTableUtil
{
module Program
open System
open Akka
open Akka.Actor
open Akka.FSharp
open Akka.Configuration
type Message =
module Program
open System
open Akka
open Akka.Actor
open Akka.FSharp
open Akka.Configuration
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Text;
@bobbychopra
bobbychopra / kiss_docker
Created December 8, 2015 01:32 — forked from include/kiss_docker
homebrew > cask > Virtualbox > Vagrant > CentOS > Docker > Ubuntu
#homebrew > cask > Virtualbox > Vagrant > CentOS > Docker > Ubuntu
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
$ brew tap caskroom/homebrew-cask
$ brew install brew-cask
$ brew cask install virtualbox
$ brew cask install vagrant
$ brew tap homebrew/completions
$ brew install vagrant-completion
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Reflection;
using System.ServiceModel;
using log4net;
namespace Bobby.Chopra
{
static class SomeService