Skip to content

Instantly share code, notes, and snippets.

View naveensrinivasan's full-sized avatar

Naveen naveensrinivasan

View GitHub Profile
@naveensrinivasan
naveensrinivasan / gist:8733267
Created January 31, 2014 14:40
Compare strings
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();
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 11:03
Set env for golang on windows
[System.Environment]::SetEnvironmentVariable("GOROOT","c:\Go","Machine")
[System.Environment]::SetEnvironmentVariable("GOPATH","c:\n\Dropbox\Go","Machine")
@naveensrinivasan
naveensrinivasan / echoHttpRequest.js
Last active August 29, 2015 14:08 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
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 August 29, 2015 14:10
Teaching kids to use bash

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.

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 March 26, 2015 14:28
Code connect install error
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 01:06
A valid ETW Trace that would generate events
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 August 29, 2015 14:20
This ETW trace wouldn't generate events because of the order of the methods with event id's within the class.
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 August 29, 2015 14:20
Measuring LINQ Any operator
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,";