Skip to content

Instantly share code, notes, and snippets.

View gist:8733267
var f = File.ReadAllLines(@"c:\n\Documents\initial.csv").First().Split(',');
var s = File.ReadAllLines(@"c:\n\Documents\second.csv").First().Split(',');
f.Zip(s,(a,b) => a + "-" + b).Dump();
View boxstarter cinst
cinst IIS-WebServerRole -source windowsfeatures
cinst IIS-HttpCompressionDynamic -source windowsfeatures
cinst IIS-ManagementScriptingTools -source windowsfeatures
cinst IIS-WindowsAuthentication -source windowsfeatures
cinst IIS-BasicAuthentication -source windowsfeatures
cinst IIS-ASPNET -source windowsfeatures
cinst IIS-ASPNET45 -source windowsfeatures
cinst IIS-ManagementConsole -source windowsfeatures
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
@naveensrinivasan
naveensrinivasan / golangenvonwindows.ps1
Created May 11, 2014
Set env for golang on windows
View golangenvonwindows.ps1
[System.Environment]::SetEnvironmentVariable("GOROOT","c:\Go","Machine")
[System.Environment]::SetEnvironmentVariable("GOPATH","c:\n\Dropbox\Go","Machine")
View echoHttpRequest.js
module['exports'] = function echoHttp (hook) {
hook.debug("Debug messages are sent to the debug console");
hook.debug(hook.params);
hook.debug(hook.req.path);
hook.debug(hook.req.method);
@naveensrinivasan
naveensrinivasan / teachingkidstousebash.md
Last active Aug 29, 2015
Teaching kids to use bash
View teachingkidstousebash.md

I have been wanting to teach my kids bash. I wanted to start of teaching them basics of bash and then slowly introduce to them the complex stuff when needed. I have two boys 8,6 and they always want somethings that are funny! I know they would remember things that have pictures.

They have been wanting to know where we are taking to them in florida for vacation. So here is funny and cool lesson for kids to learn bash and figure to where we are going.

I created a file called florida and stored it in the home directory with information they were looking for. The below is the markdown I shared with them.

View vimrc
set nohud
set nosmoothscroll
set noautofocus " The opposite of autofocus; this setting stops
" sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"
set typelinkhints
let hintcharacters = "asdlkj123"
@naveensrinivasan
naveensrinivasan / Codeconnceterror
Created Mar 26, 2015
Code connect install error
View Codeconnceterror
3/26/2015 10:24:14 AM - Microsoft VSIX Installer
3/26/2015 10:24:14 AM - -------------------------------------------
3/26/2015 10:24:14 AM - Initializing Install...
3/26/2015 10:24:14 AM - Extension Details...
3/26/2015 10:24:14 AM - Identifier : 8b3879a2-395c-4a46-a4d3-c7b95a248989
3/26/2015 10:24:14 AM - Name : Code Connect Alpha
3/26/2015 10:24:14 AM - Author : Code Connect
3/26/2015 10:24:14 AM - Version : 0.4.0.4
3/26/2015 10:24:14 AM - Description : Quickly navigate and edit software on a function-by-function basis.
3/26/2015 10:24:14 AM - Locale : en-US
@naveensrinivasan
naveensrinivasan / GoodETWTrace
Created May 4, 2015
A valid ETW Trace that would generate events
View GoodETWTrace
using System.Diagnostics.Tracing;
namespace ETWSample
{
public sealed class TestEvent : EventSource
{
static public TestEvent Trace = new TestEvent();
public void WriteEvent(string content)
{
WriteEvent(1, content);
@naveensrinivasan
naveensrinivasan / FailedETWTrace
Last active Aug 29, 2015
This ETW trace wouldn't generate events because of the order of the methods with event id's within the class.
View FailedETWTrace
using System.Diagnostics.Tracing;
namespace ETWSample
{
/// <summary>
/// This event would not be traced because the order of the
/// function should be in the order of the parameters.
/// </summary>
public class FailedEvent : EventSource
{
@naveensrinivasan
naveensrinivasan / gist:9153a580b7f4bda55a38
Last active Aug 29, 2015
Measuring LINQ Any operator
View gist:9153a580b7f4bda55a38
var useAny = false;
var loremipsum = @"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo
ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes,
nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.
Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget,
arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu
pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean
vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac,
enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a,";